Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] PowerState sometimes returns null #1249

Closed
3 tasks
shahzzzam opened this issue Jul 14, 2021 · 7 comments
Closed
3 tasks

[BUG] PowerState sometimes returns null #1249

shahzzzam opened this issue Jul 14, 2021 · 7 comments

Comments

@shahzzzam
Copy link

Describe the bug
We use the Microsoft.Azure.Management.Compute.Fluent SDK 1.34.0. We use the library to check the PowerState of a VM inside VMSS.

Sometimes, the PowerState property returned from IVirtualMachineScaleSetVM object returns null.

What is the meaning of that? PowerState is an enum containing only following values:

public static readonly PowerState Running;
        //
        // Summary:
        //     Static value PowerState/deallocating for PowerState.
        public static readonly PowerState Deallocating;
        //
        // Summary:
        //     Static value PowerState/deallocated for PowerState.
        public static readonly PowerState Deallocated;
        //
        // Summary:
        //     Static value PowerState/starting for PowerState.
        public static readonly PowerState Starting;
        //
        // Summary:
        //     Static value PowerState/stopped for PowerState.
        public static readonly PowerState Stopped;
        //
        // Summary:
        //     Static value PowerState/stopping for PowerState.
        public static readonly PowerState Stopping;
        //
        // Summary:
        //     Static value PowerState/unknown for PowerState.
        public static readonly PowerState Unknown;

Exception or Stack Trace
Add the exception log and stack trace if available

To Reproduce
Steps to reproduce the behavior:

Code Snippet
Add the code snippet that causes the issue.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

  • OS: [e.g. iOS]
  • IDE : [e.g. IntelliJ]
  • Version of the Library used

Additional context
Add any other context about the problem here.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
@weidongxu-microsoft
Copy link
Member

@shahzzzam

I think compute service stated in a previous issue that this is caused that service cannot determine the state at this particular time of the request.

My suggestion is either check in some later time, or kind of assume that VM instance works (until next check).

@shahzzzam
Copy link
Author

What about calling RefreshInstanceView() on the VM. Will that update the state?
I also see the state Unknown and I am wondering whats the difference between null and Unknown.

@weidongxu-microsoft
Copy link
Member

@shahzzzam
I am not exactly sure. I will loop in service for answer.

@ghost
Copy link

ghost commented Jul 20, 2021

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Drewm3, @avirishuv.

Issue Details

Describe the bug
We use the Microsoft.Azure.Management.Compute.Fluent SDK 1.34.0. We use the library to check the PowerState of a VM inside VMSS.

Sometimes, the PowerState property returned from IVirtualMachineScaleSetVM object returns null.

What is the meaning of that? PowerState is an enum containing only following values:

public static readonly PowerState Running;
        //
        // Summary:
        //     Static value PowerState/deallocating for PowerState.
        public static readonly PowerState Deallocating;
        //
        // Summary:
        //     Static value PowerState/deallocated for PowerState.
        public static readonly PowerState Deallocated;
        //
        // Summary:
        //     Static value PowerState/starting for PowerState.
        public static readonly PowerState Starting;
        //
        // Summary:
        //     Static value PowerState/stopped for PowerState.
        public static readonly PowerState Stopped;
        //
        // Summary:
        //     Static value PowerState/stopping for PowerState.
        public static readonly PowerState Stopping;
        //
        // Summary:
        //     Static value PowerState/unknown for PowerState.
        public static readonly PowerState Unknown;

Exception or Stack Trace
Add the exception log and stack trace if available

To Reproduce
Steps to reproduce the behavior:

Code Snippet
Add the code snippet that causes the issue.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

  • OS: [e.g. iOS]
  • IDE : [e.g. IntelliJ]
  • Version of the Library used

Additional context
Add any other context about the problem here.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
Author: shahzzzam
Assignees: -
Labels:

Compute - VM, Service Attention

Milestone: -

@amjads1 amjads1 assigned amjads1 and avirishuv and unassigned amjads1 Jul 20, 2021
@amjads1
Copy link

amjads1 commented Jul 20, 2021

@avirishuv Could you please look into the issue?

@avirishuv
Copy link

hi @shahzzzam the power state of VMs can sometimes fail to be retrieved as mentioned in this issue Azure/azure-powershell#13178
Please let us know if that helps. Happy to answer any additional questions.

@avirishuv
Copy link

@shahzzzam Are there any additional questions on this topic? If not, can we close the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants