WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

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

To: 'Marco Sinhoreli' <msinhore@xxxxxxxxx>, xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-API] problem to change VLAN tag in XCP 0.5.0
From: Rob Hoes <Rob.Hoes@xxxxxxxxxx>
Date: Tue, 3 Aug 2010 11:18:17 +0100
Accept-language: en-US
Acceptlanguage: en-US
Cc:
Delivery-date: Tue, 03 Aug 2010 03:18:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AANLkTikp6mgLQ9oYBEfPEKyy5zrTchTt4d3wDmu3T=8M@xxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <AANLkTikp6mgLQ9oYBEfPEKyy5zrTchTt4d3wDmu3T=8M@xxxxxxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcsyUL7NQ84b+FO5RG2toStzhBV14QAomBag
Thread-topic: [Xen-API] problem to change VLAN tag in XCP 0.5.0
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
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>