8000 Ohai simultaneously detects EC2 and Azure clouds · Issue #1743 · chef/ohai · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Ohai simultaneously detects EC2 and Azure clouds #1743
Open
@thheinen

Description

@thheinen

Description

No, this is not a new hybrid cloud strategy ;-)

On customer Windows machines which include the Microsoft Monitoring Agent, the cloud.rb Ohai plugin crashes and thus does not provide data. Reason is, that the azure.rb plugin checks for an existing C:\WindowsAzure directory instead of directly going to metadata. The Microsoft Monitoring Agent, which is independent of Azure, seems to sometimes place install logs there.

As subsequently the cloud.rb plugin tries to access metadata attributes with metadata being nil and crashes silently, the cloud Mash never gets populated.

Ohai Version

Ohai 17.3.1

Platform Version

Windows Server 2016

Ohai Output

C:\Windows\system32>ohai
[2022-03-29T11:43:55+00:00] WARN: Mixin AzureMetadata: Received response code 404 requesting metadata
C:\Windows\system32>ohai cloud
C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/ohai-17.3.1/lib/ohai/plugins/hostname.rb:194: warning: Socket.gethostbyname is deprecated; use Addrinfo.getaddrinfo instead.
[2022-03-29T11:44:29+00:00] WARN: Mixin AzureMetadata: Received response code 404 requesting metadata
C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/ohai-17.3.1/lib/ohai/system.rb:185:in `attributes_print': I cannot find an attribute named cloud! (ArgumentError)
        from C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/ohai-17.3.1/lib/ohai/application.rb:151:in `block in run_application'
        from C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/ohai-17.3.1/lib/ohai/application.rb:150:in `each'
        from C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/ohai-17.3.1/lib/ohai/application.rb:150:in `run_application'
        from C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/ohai-17.3.1/lib/ohai/application.rb:92:in `block in run'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/benchmark.rb:308:in `realtime'
        from C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/ohai-17.3.1/lib/ohai/application.rb:90:in `run'
        from C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/ohai-17.3.1/bin/ohai:25:in `<top (required)>'
        from C:/opscode/chef/bin/ohai:167:in `load'
        from C:/opscode/chef/bin/ohai:167:in `<main>'
C:\Windows\system32>ohai azure
[2022-03-29T11:44:34+00:00] WARN: Mixin AzureMetadata: Received response code 404 requesting metadata
{
  "metadata": null
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugDoes not work as expected.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0