[ 
https://issues.apache.org/jira/browse/LIBCLOUD-322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13653635#comment-13653635
 ] 

Trevor Powell (RMS) commented on LIBCLOUD-322:
----------------------------------------------

Anyone else get an error when they use POOL with this patch?


  File "/usr/lib/python2.6/site-packages/libcloud/compute/drivers/vcloud.py", 
line 2061, in create_node
    self._change_vm_ipmode(vapp_href, ex_vm_ipmode, ex_vm_ipaddress)
  File "/usr/lib/python2.6/site-packages/libcloud/compute/drivers/vcloud.py", 
line 1950, in _change_vm_ipmode
    c.find(fixxpath(c, 'IpAddressAllocationMode')).text = set_vm_ipmode
UnboundLocalError: local variable 'set_vm_ipmode' referenced before assignment


.............
        for vm in vms:
            res = self.connection.request(
                '%s/networkConnectionSection' % get_url_path(vm.get('href')))
            net_conns = res.object.findall(
                fixxpath(res.object, 'NetworkConnection'))
            for c in net_conns:
                c.find(fixxpath(c, 'IpAddressAllocationMode')).text = 
set_vm_ipmode
            if (vm_ip_address and set_vm_ipmode == 'MANUAL'):
                ip_element_tag = fixxpath(res.object, 'IpAddress')
                root = net_conns[0]
                ip_elem = ET.Element(ip_element_tag)
                root.insert(1, ip_elem)
                ip_elem.text = vm_ip_address
            else:
                raise ValueError("IP address is required if IP Mode is set to 
%s" % vm_ipmode)


                
> Allow assignment of manual IP address for VM's in vCloud
> --------------------------------------------------------
>
>                 Key: LIBCLOUD-322
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-322
>             Project: Libcloud
>          Issue Type: New Feature
>          Components: Compute
>    Affects Versions: 0.12.3
>            Reporter: Kashif Ali
>            Priority: Minor
>             Fix For: 0.12.3
>
>         Attachments: vcloud_manual_ip.patch, vcloud.py.patch
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> This is an initial ticket for my patch to provide the vCloud driver with an 
> implementation of assigning a manual static IP address to a VM inside a vAPP.
> NOTE: currently the patch only works for one VM inside a vAPP but can be 
> easily extended to cover multiple VM's (I will work on providing multi VM per 
> vAPP static address assignment also).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to