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

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


  • To: Rob Hoes <Rob.Hoes@xxxxxxxxxx>
  • From: Marco Sinhoreli <msinhore@xxxxxxxxx>
  • Date: Wed, 4 Aug 2010 14:59:19 -0300
  • Cc: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 04 Aug 2010 10:59:45 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=n/RP+B1jkE0+6jhK6CQTellf3oO9iK/GTc4DY/APsJM6ViKxazxHyj37flp4xZGPwc 7JyhGZ8erdySeDs1ZKy7rQBhTZ2vvuseDD+zttcl+VCpKe2MyZxI/7eK+zuNSq7reI6J fyBV7sm3xTP9hAEcBaHJ7D/+dZNo+tQN00H0w=
  • List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>

Rob:

Thank you for your help. I fixed this one and now is working fine.

Cheers!

On Tue, Aug 3, 2010 at 7:18 AM, Rob Hoes <Rob.Hoes@xxxxxxxxxx> wrote:
> Hi Marco,
>
> The error suggests that a VLAN with the same tag already exists on one of the 
> PIFs you are trying to create a VLAN on. Would that be possible in your 
> setup? I don't see anything in your code that checks for this. Note that 
> Pool.create_VLAN_from_PIF tries to create VLANs on all hosts in the pool.
>
> Cheers,
> Rob
>
>> -----Original Message-----
>> From: xen-api-bounces@xxxxxxxxxxxxxxxxxxx [mailto:xen-api-
>> bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Marco Sinhoreli
>> Sent: 02 August 2010 15:40
>> To: xen-api
>> Subject: [Xen-API] problem to change VLAN tag in XCP 0.5.0
>>
>> 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
>



-- 
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®.