Skip to content

Commit 5350e61

Browse files
committed
CLOUDSTACK-7494. Migration of a vm fails on Hyper-V. In an earlier commit as part of
cleaning up vmsync changes, checkvirtualmachine command was updated to return the power state of the vm. The change was missed for Hyper-V. This caused migration to fail on cloudstack even though it used to succeed on the hypervisor. Updated the hyper-v agent code to return the cloudstack equivalent power state for check virtual machine answer.
1 parent 7cdb67d commit 5350e61

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ public JContainer CheckVirtualMachineCommand([FromBody]dynamic cmd)
873873
string details = null;
874874
bool result = false;
875875
string vmName = cmd.vmName;
876-
string state = null;
876+
string powerState = null;
877877

878878
// TODO: Look up the VM, convert Hyper-V state to CloudStack version.
879879
var sys = wmiCallsV2.GetComputerSystem(vmName);
@@ -884,15 +884,15 @@ public JContainer CheckVirtualMachineCommand([FromBody]dynamic cmd)
884884
}
885885
else
886886
{
887-
state = EnabledState.ToCloudStackState(sys.EnabledState); // TODO: V2 changes?
887+
powerState = EnabledState.ToCloudStackPowerState(sys.EnabledState);
888888
result = true;
889889
}
890890

891891
object ansContent = new
892892
{
893893
result = result,
894894
details = details,
895-
state = state,
895+
powerstate = powerState,
896896
contextMap = contextMap
897897
};
898898
return ReturnCloudStackTypedJArray(ansContent, CloudStackTypes.CheckVirtualMachineAnswer);

0 commit comments

Comments
 (0)