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] The method Pool.create_VLAN_from_PIF does not work

To: Владислав Григорьев <wadic@xxxxxxxxxxxxx>
Subject: Re: [Xen-API] The method Pool.create_VLAN_from_PIF does not work
From: Jonathan Ludlam <Jonathan.Ludlam@xxxxxxxxxxxxx>
Date: Thu, 22 Sep 2011 23:34:44 +0100
Accept-language: en-US
Acceptlanguage: en-US
Cc: "xen-api@xxxxxxxxxxxxxxxxxxx" <xen-api@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 22 Sep 2011 15:35:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <EBF7A39719D5474C915EC0F21C57DD3B082CDE37@xxxxxxxxxxxxxxxxxx>
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: <EBF7A39719D5474C915EC0F21C57DD3B082CDE37@xxxxxxxxxxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acx5d9b14/EW9iWjQHqJLbRwDP/0WQ==
Thread-topic: [Xen-API] The method Pool.create_VLAN_from_PIF does not work
Looks like you're using the uuids instead of the references? Few API calls take uuids, mostly they use the refs.

Jon

On 21 Sep 2011, at 13:20, Владислав Григорьев wrote:

Hi!
I’m using XenAPI .NET library to create external interface on XenServer. Here is my code:
 
// creating session to hypervisor
hypervisor.Connect();
 
// creating new network
XenAPI.Network xnet = new XenAPI.Network();
xnet.name_description = this.Domain.Name;
xnet.name_label = "vlan" + vlan.ToString();
XenRef<XenAPI.Network> xnet1 = XenAPI.Network.create(hypervisor.session, xnet);
 
// get device for new vlan bridging
var eth = PIF.get_all_records(hypervisor.session).Values.Where(v => v.VLAN == -1 && v.device == dev).FirstOrDefault();
 
// get created network object
var net = XenAPI.Network.get_record(hypervisor.session, xnet1.opaque_ref);
 
// create vlan interface
List<XenRef<PIF>> pifs = Pool.create_VLAN_from_PIF(hypervisor.session, eth.uuid, net.uuid, (long)vlan);
 
At this place I have an exception like this:
“Object has been deleted.PIF:a21c28df-d6e8-0980-075d-014bd9cd666e”
 
I have checked that the objects and eth net have the correct uuid. When I use xe command to create vlan interface with same values  “xe pool-vlan-create pif_uuid=… network_uuid=… vlan=…”  - its works fine.
What’s wrong?
 
_______________________________________________
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>