April 5, 2018

Still running into problems with the Elasticsearch scaleset. With the new image using the init script in root’s cron on reboot, the mount command to attach the local assets folder to the azure file storage doesn’t happen. I can t tell if it’s just not getting cxalled or if its failing in some way. When it’s run at the command line everything works like a charm, but when run at startup the templating eval commands generate empty .yml and defaults files bercause there’s no source file.

So I switched, at least temporarily, back to the vm extension, but get the same result when running the script with sudo sh test.sh. Removing the sh from the extension’s commandToExecute causes an error:

azurerm_virtual_machine_scale_set.es_ss: Long running operation terminated with status 'Failed': Code="VMExtensionProvisioningError" Message="VM has reported a failure when processing extension 'test'. Error message: \"Enable failed: failed to execute command: command terminated with exit status=1\n[stdout]\n\n[stderr]\nsudo: es-shell-test.sh: command not found\n\"."

In the end I needed to go with bash without the sudo; the templating is a bash feature, and I suspect the commandToExecutew runs as root. #