[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-API] problem to change VLAN tag in XCP 0.5.0


  • To: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
  • From: Marco Sinhoreli <msinhore@xxxxxxxxx>
  • Date: Mon, 2 Aug 2010 11:40:25 -0300
  • Delivery-date: Mon, 02 Aug 2010 07:41:02 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=xQQPFWcEE8oqBFj38uFDHSW94Sk/AUK8t5Kq5l4L5gu8OU0dJIKWGQsxVg+0iHnOHT vHDT3uj6nKsiK6RXUuDbXLblgVvtLMQSngsIVX4ByoBoMFMmcmod8/3uTjZ7+rrYOT1B 7zmxKIEHR58Qz3O6HkV4as31yWQAS+6z1hpsU=
  • List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>

Hello guys:

I have an incompatible between XCP 0.1.0 and 0.5.0 to change VLAN tag.
Before, to change the virtual machine VLAN tag in XCP 0.1.0, I used
this code:

<code>
vm_rcd = self.master.VM.get_record(vm)
for vif in vm_rcd['VIFs']:
    vif_rcd = self.master.VIF.get_record(vif)
    if vif_rcd['currently_attached'] == True:
        self.master.VIF.unplug(vif)
    self.master.VIF.destroy(vif)

pifs = self.master.host.get_PIFs(master)
    pif_vlan = None
    for pif in pifs:
        pif_rcd = self.master.PIF.get_record(pif)
        if vlan == int(pif_rcd['VLAN']) and device == pif_rcd['device']:
            pif_vlan = pif
            break


ref_args = {
                'current_operations': {},
                'tags': [],
                'other_config': {'automatic': 'false'},
                'name_label': 'eth0',
                'VIFs': [],
                'allowed_operations': [],
                'name_description': 'Added by globo.com orchestration system.',
                'blobs': {}
                }

network = self.master.network.create(ref_args)
pif = self.__find_pif(host, device)
self.master.pool.create_VLAN_from_PIF(pif, network, str(vlan))
</code>

These before was working fine. Now, using XCP 0.5.0 the last line
"self.master.pool.create_VLAN_from_PIF(pif, network, str(vlan))"
return an exception:

<log>
    self.master.pool.create_VLAN_from_PIF(pif, network, str(vlan))
  File 
"/mnt/projetos/deploy-be/virt/orquestracao/integration/releases/24_03_2010_18_58_21/vmo-integration/lib/integration/xenapi/XenAPI.py",
line 216, in __call__
    return self.__send(self.__name, args)
  File 
"/mnt/projetos/deploy-be/virt/orquestracao/integration/releases/24_03_2010_18_58_21/vmo-integration/lib/integration/xenapi/XenAPI.py",
line 142, in xenapi_request
    result = _parse_result(getattr(self, methodname)(*full_params))
  File 
"/mnt/projetos/deploy-be/virt/orquestracao/integration/releases/24_03_2010_18_58_21/vmo-integration/lib/integration/xenapi/XenAPI.py",
line 191, in _parse_result
    raise Failure(result['ErrorDescription'])
Failure: PIF_VLAN_EXISTS
</log>

Thoughts?

Cheers,


-- 
Marco Sinhoreli

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.