CLOUDSTACK-6519 [Hyper-V] while adding VM to Network it should throw error when it is in running state

This commit is contained in:
Rajesh Battala 2014-05-13 11:39:14 +05:30 committed by Daan Hoogland
parent a7bf66b9f0
commit 799480cf05
1 changed files with 4 additions and 0 deletions

View File

@ -531,6 +531,10 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S
try {
String vmName = cmd.getVmName();
if(cmd.getVMType() == VirtualMachine.Type.User) {
s_logger.error("Vm in Running state cannot be added to new network.Nic cannot be plugged to VM in running state");
return new PlugNicAnswer(cmd, false, "Vm in Running state cannot be added to new network.Nic cannot be plugged to VM in running state");
}
NicTO nic = cmd.getNic();
URI broadcastUri = nic.getBroadcastUri();
if (BroadcastDomainType.getSchemeValue(broadcastUri) != BroadcastDomainType.Vlan) {