azure-sdk-for-net
azure-sdk-for-net copied to clipboard
[BUG] VM Restart does not behave like Start or Stop
Describe the bug
VirtualMachinesOperations::StartRestartAsync
does not behave like VirtualMachinesOperations::StartStartAsync
or VirtualMachinesOperations::StartPowerOffAsync
await (await computeClient.VirtualMachines.StartPowerOffAsync(resourceGroup, machineName)).WaitForCompletionAsync();
returns when after the machine is off
await (await computeClient.VirtualMachines.StartRestartAsync(resourceGroup, machineName)).WaitForCompletionAsync();
return after 2 seconds and the machine gets restarted a while after this call completed
Expected behavior
calling WaitForCompletionAsync
does not complete until the command is completed
Actual behavior (include Exception or Stack Trace)
WaitForCompletionAsync
completes before the command is completed
More problems
I also noticed that if I run a script using StartRunCommandAsync
after the call to machine restart as detailed above the machine will get restarted in the middle of the script but the VirtualMachinesRunCommandOperation::HasCompleted
will still be set to true
Environment:
<PackageReference Include="Azure.ResourceManager.Compute" Version="1.0.0-preview.2" />
Thank you for your feedback. Tagging and routing to the team member best able to assist.
Thanks for your feedback, re-routing to area owner.
@HarveyLink please help to test if this is a client issue or service issue
Hi @cfauchere
This issue has been resolved in our latest release, please try the latest package Azure.ResourceManager.Compute-1.0.1
Hi, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!