I am unable to work out how to temporarily disconnect a VM from a network. I am looking to be able to simulate unplugging the network cable from the VM. Reasons to do this might be to perform initial network config that would not be compatible with other machines or to test a machine or software response to such an event.
The only way I can think of to acheive this is to 'Create a logical network on a single server' for each server and change the network card's network to that network. This requires I create one network for each server and only have one VM on each server moved to that network. I beleive it requires the VM to be power cycled to make it take effect so doesn't allow testing of a live disconnect/reconnect.
It feels like there should be a simpler way to acheive this, can anyone point me in the direction of a better solution?
The machine I was trying to do this with is a Linux machine but it was more of a general question and intended to apply to any guests. I realise I can log into the console and perform an OS specific action that will disable the network. I just wanted to see if it were possible to remove the guest from the network externally. Ie simulate a 'network cable unplug'.
As I mentioned reasons for this could be something like testing or debugging a software response to disconnect or quarantining a problem guest. If it were the latter then it may not be ideal to bring the guest up onto the network before then disabling the networking.