azure-sdk-for-net icon indicating copy to clipboard operation
azure-sdk-for-net copied to clipboard

[BUG] VM Restart does not behave like Start or Stop

Open cfauchere opened this issue 3 years ago • 5 comments

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" />

cfauchere avatar Mar 31 '21 04:03 cfauchere

Thank you for your feedback. Tagging and routing to the team member best able to assist.

jsquire avatar Mar 31 '21 13:03 jsquire

Thanks for your feedback, re-routing to area owner.

JonathanCrd avatar Mar 31 '21 18:03 JonathanCrd

@HarveyLink please help to test if this is a client issue or service issue

ArthurMa1978 avatar Jan 10 '23 06:01 ArthurMa1978

Hi @cfauchere This issue has been resolved in our latest release, please try the latest package Azure.ResourceManager.Compute-1.0.1

dvbb avatar Feb 07 '23 07:02 dvbb

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!

ghost avatar Feb 14 '23 08:02 ghost