// If there is a gateway network, we have to wait until the network
// configuration links are
// available
if (task != null) {
VirtualMachineState originalState = target.getState();
VirtualMachineMonitor monitor = context.utils().injector().getInstance(MonitoringService.class)
.getVirtualMachineMonitor();
monitor.awaitState(originalState, this);
}
// Set the new network configuration
// Refresh virtual machine, to get the new configuration links