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

Cloud helper functions return incorrect results after nodes are moved between clouds (Azure -> AWS) #14215

Open
inhearst opened this issue Jan 30, 2024 · 0 comments
Labels
Status: Untriaged An issue that has yet to be triaged.

Comments

@inhearst
Copy link

inhearst commented Jan 30, 2024

Description

We sometimes move nodes between different clouds and end up with situations where the cloud helper functions return erroneous results. For example, when a node was moved from Azure to AWS, ohai reports azure is present, but azure.metadata is null

{
  "azure": {
    "metadata": null
  },
  "ec2": {
    "account_id": "..."
  }
}

Also note cloud key is missing for the attributes in the example. And to be clear the node can be seen still running in the EC2 console, all the AWS attributes are valid.

Result of helpers for above node:

chef (17.10.3)> ec2?
=> true
chef (17.10.3)> azure?
=> true
chef (17.10.3)> cloud?
=> false

We expected true, false and true in this case. The node is still running in ECS. Also we don't understand how cloud? can ever be false if one of the cloud provider helpers is true.

Sometimes the cloud metadata is missing too, even though the node is running in EC2 or similar. We think this may have to do with moving a node from on-prem to the cloud.

Checking the helper methods, it looks like they only check for the presence of the azure key and such. Maybe more robust checking is needed for edge cases like these.

Chef Version

17.10.3

Platform Version

WSL Ubuntu 22.04.03 LTS

Replication Case

  1. Transfer node from Azure to AWS, or on-prem to Azure to AWS
  2. Observe metadata that retains/misses azure or cloud attributes
@inhearst inhearst added the Status: Untriaged An issue that has yet to be triaged. label Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Untriaged An issue that has yet to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant