1

I'm presently hosting an Azure Scale set running Windows Server 2012 R2 that is setup with the Chef extension (Chef.Bootstrap.WindowsAzure.ChefClient). When the VM is provisioned, the extension reports back that it succeeded via the Azure portal however the registered node on the Chef server is not updated to retain the provided run list and the first run isn't fully completed. This is causing subsequent chef-client runs to be performed with an empty run list. When I observe the reports on chef server, I see a run with a status of aborted with no error.

Upon review of the WindowsAzure Plugins chef-client.log file, I can see that it tries to execute the run list but seems to be interrupted with the following FATAL

FATAL: Errno::EINVAL: Invalid argument @ io_writev - <STDOUT>

There is no chef-stacktrace.out file created as well. The ARM extension definition looks like:

{
    "type": "extensions",
    "name": "ChefClient",
    "properties": {
        "publisher": "Chef.Bootstrap.WindowsAzure",
        "type": "ChefClient",
        "typeHandlerVersion": "1210.12",
        "autoUpgradeMinorVersion": true,
        "settings": {
            "client_rb": "ssl_verify_mode :verify_none\nnode_name ENV[\"COMPUTERNAME\"]",
            "runlist": "recipe[example]",
            "autoUpdateClient": "false",
            "deleteChefConfig": "false",

            "bootstrap_options": {
                "chef_server_url": "https://mychefserver.com/organizations/myorg",
                "validation_client_name": "myorg-validator",
                "environment": "dev"
            }
        },
        "protectedSettings": {
            "validation_key": "-----BEGIN RSA PRIVATE KEY----- ... -----END RSA PRIVATE KEY----"
        }
    }
}

In order to troubleshoot, I've tried to reduce my example cookbook down to a single DSC script which installs IIS. Even this step, I've executed it multiple ways such as using windows_feature, powershell_script, and dsc_script. All result end up with the same error. Here is the current script

powershell_script 'Install IIS' do
  code 'Add-WindowsFeature Web-Server'
  guard_interpreter :powershell_script
  not_if "(Get-WindowsFeature -Name Web-Server).Installed"
end

If I override the run list and call chef-client manually, everything succeeds. I'm having trouble honing in on whether this is the Azure Chef Extension, the Chef client, or the cookbook.

As far as I can tell, communication with the Chef server looks good as the necessary pem files are exchanged, chef-client is installed, and the cookbook is downloaded and cached from the server. The cache gets removed on the subsequent run however with the empty run list. Here are the contents of first-boot.json:

{"run_list":["recipe[example]"]}

Here are the versions in play:

  • chef-client version: 14.1.12
  • Azure Chef Extension version: 1210.12.110.1001
  • Server version: Windows Server 2012 R2

Any ideas what could be going on?

sticky bit
  • 36,626
  • 12
  • 31
  • 42
Scott
  • 658
  • 6
  • 16

1 Answers1

0

It turns out my analysis was incorrect about which resource was causing the problem. It appears that the first boot run was failing when using dsc_script as the resource to install the web server. When using the following powershell_script resource, it succeeded and the run list attached for future runs.

powershell_script 'Install IIS' do code 'Add-WindowsFeature Web-Server' guard_interpreter :powershell_script not_if "(Get-WindowsFeature -Name Web-Server).Installed" end

Scott
  • 658
  • 6
  • 16