3

Running Chef's knife bootstrap command successfully populates the cloud_v2 attribute via Ohai when I bootstrap VMs created on Google Cloud and Rackspace, but on Azure VMs bootstraping via knife leaves the cloud_v2 hash very empty -- it only gets populated with one attribute: provder: azure.

In contrast, Ohai successfully populates Google Cloud and Rackspace nodes with something that looks like:

cloud_v2: public_ipv4_addrs 0: xxx.xxx.xxx.85 local_ipv4_addrs 0: 10.240.0.2 provider: gce local_hostname: myhostname.projectname.internal public_ipv4: xxx.xxx.xxx.85 local_ipv4: 10.240.0.2

Is this a bug in Azure's Ohai plugin? How can I get the Knife bootstrap command to include more of the default Ohai attributes? Most specifically I need the public_ipv4 so I can use this attribute to run the knife ssh commands.

Eternal Rubyist
  • 3,445
  • 4
  • 34
  • 51
  • What is the output of running `sudo chef-client -l debug -VV`? – Ivan Nov 13 '16 at 19:55
  • @Ivan `-vv` gives `invalid option: -VV (OptionParser::InvalidOption)` along with a stacktrace (is that last argument a valid chef option?). Running `sudo chef-client -l debug -v` (with a single lowercase "v") outputs my Chef version which is `Chef: 12.16.42` – Eternal Rubyist Nov 14 '16 at 17:40
  • then `sudo chef-client -l debug` please, I don't remember the options but the idea is to make recipes log as much stuff as possible – Ivan Nov 14 '16 at 20:13

1 Answers1

1

Ohai only supports limited auto-detection of Azure. If you touch the hint file (mydir -p /etc/chef/ohai/hints && touch /etc/chef/ohai/hints/azure.json) it should see things better. This is generally handled for you automatically if you use the relevant knife-$cloud plugin but with plain knife bootstrap you need to do it either via the --hint option or manually as above.

coderanger
  • 52,400
  • 4
  • 52
  • 75