Simulating network cable disconnect
-
Hi, Everyone.
Does XCP-NG or Xen Orchestra have an option to simulate a network cable disconnect? Because in Xen Orchestra, if I go to the VM Guest and go to the network tab and press disconnect on the VIF. It removes the network interface on the VMGuest, so any software that requires a network interface (in my case wireshark), the software just errors out or won't work.
-
xe vif-unplug uuid=[vif_uuid]
or use XenCenter and on
Network
tab press buttonDeactivate
-
IIRC,
vif-unplug
is exactly the same as "Disconnect" in XO. You might be better to use ovs commands to stop traffic without the guest knowing. -
thanks for the reply, I am trying to check the ovs command and what would be the best parameter to use to simulate this.
Also if possible maybe this can be added as feature request in future release for XO. This will help when trying to do some test on certain application and also for studies (like in my case trying to learn wireshark). This is a great to have feature.
-
OVS API isn't exposed in XAPI, so the answer is no. You can have however use the SDN features of XO or use allowed IP to artificially block it.
-
Thanks for sharing that information.
-
This is an old thread, but to keep it in one place: is there any option to start a VM with disconnected vif?
-
I think the VIF is connected automatically on boot. The best approach is to remove the VIF and create it anytime later when you need it.
-
@KPS said in Simulating network cable disconnect:
This is an old thread, but to keep it in one place: is there any option to start a VM with disconnected vif?
as workaround/trick you can use locking mode.
Set it to "locked" and do not allow any IP, so all traffic will be dropped on this VIF. It will be like "disabled". After that you can set locking mode to "unlocked" to allow any traffic. -
@splastunov
Great idea! Thank you!