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

CustomScriptExtension fails for Windows VM #12

Open
asote opened this issue Jan 9, 2018 · 4 comments
Open

CustomScriptExtension fails for Windows VM #12

asote opened this issue Jan 9, 2018 · 4 comments

Comments

@asote
Copy link

asote commented Jan 9, 2018

Set commandToExecute as follows

settings = <<SETTINGS
    {
        "commandToExecute": "powershell Add-WindowsFeature Web-Server,Web-Asp-Net45,NET-Framework-Features"
    }
    SETTINGS

Fails with the following message:

  • azurerm_virtual_machine_scale_set.vm-windows: compute.VirtualMachineScaleSetsClient#CreateOrUpdate: Failure sending request: StatusCode=200 -- Original Error: Long running operation terminated with status 'Failed': Code="VMExtensionProvisioningError" Message="VM has reported a failure when process
    ing extension 'vmssextension'. Error message: "Invalid handler configuration. Exiting. Error Message: Expecting state 'Element'.. Encountered 'Text'
    with name '', namespace ''. "."
@dtzar
Copy link
Contributor

dtzar commented Jan 9, 2018

@asote Have you tried using a file or using powershell.exe versus powershell at the start?
"commandToExecute": "powershell.exe . . . -File './scripts/myscript.ps1'"
Please see futher documentation
Also - it's possible there is a problem with the current module using an outdated version 1.8 versus the current 1.9 Windows script extension. You can try out the code in this branch also which uses the latest script updates.
Please let us know if one of the above worked for you.

@asote
Copy link
Author

asote commented Jan 10, 2018 via email

@dtzar
Copy link
Contributor

dtzar commented Jan 10, 2018

@asote Can you please try your original command with the latest code in my PR branch which uses the new version of the extension? I'd like to avoid modifying the module to utilize fileUris for now.

@dtzar dtzar removed their assignment Mar 29, 2018
@dtzar
Copy link
Contributor

dtzar commented May 16, 2018

I just verified that the commandToExecute by itself (as this module is today) works. I used this specifically, for example:
powershell Invoke-WebRequest -Uri https://downloads.puppetlabs.com/windows/puppet5/puppet-agent-5.5.1-x64.msi -OutFile C:/windows/temp/agent.msi
and I saw the agent.msi file present in the directory.

The fileUris is also a valid configuration / way to do this, but I view this as a new feature request to this module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants