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

Re: [Xen-API] The method Pool.create_VLAN_from_PIF does not work


  • To: Владислав Григорьев <wadic@xxxxxxxxxxxxx>
  • 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
  • List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
  • 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

 


Rackspace

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