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

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


  • To: "xen-api@xxxxxxxxxxxxxxxxxxx" <xen-api@xxxxxxxxxxxxxxxxxxx>
  • From: Владислав Григорьев <wadic@xxxxxxxxxxxxx>
  • Date: Wed, 21 Sep 2011 12:20:43 +0000
  • Accept-language: ru-RU, en-US
  • Delivery-date: Wed, 21 Sep 2011 05:21:23 -0700
  • List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
  • Thread-index: Acx4WNu6J+U4bmLQSeSeajvNSxZgpw==
  • Thread-topic: The method Pool.create_VLAN_from_PIF does not work

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

 


Rackspace

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