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?