New Question

eduardohki's profile - activity

2016-07-27 04:09:58 +0200 commented answer Issue running powershell scripts in user_data (openstack configdriver)

Hi, I've tested again and again, still no success. My user_data content is: http://paste.ubuntu.com/21084228/ The cloudbase-init.log is: http://paste.ubuntu.com/21084408/ The unattend log is: http://paste.ubuntu.com/21084468/ Thanks!

2016-07-22 21:44:32 +0200 commented answer Issue running powershell scripts in user_data (openstack configdriver)

Actually I was editing them in Gedit, with the "CRLF" endline type. But I'll try it. Thanks!

2016-07-18 14:20:57 +0200 commented answer Issue running powershell scripts in user_data (openstack configdriver)

I'm using this in the Cloudbase Windows Image for KVM, using configDrive without OpenStack. I've already tried the script you pasted, as "user_data" file in the "latest" folder, but IDK why is not working... Thanks!

2016-07-18 14:17:08 +0200 received badge  Famous Question (source)
2016-07-18 02:59:58 +0200 received badge  Notable Question (source)
2016-07-18 02:59:58 +0200 received badge  Popular Question (source)
2016-07-17 07:41:42 +0200 received badge  Editor (source)
2016-07-17 07:40:45 +0200 asked a question Issue running powershell scripts in user_data (openstack configdriver)

Hi,

I'm trying to use user_data to run some powershell scripts in the host installation.

I followed the user_data documentation, and I tried the following script to add multiple IP's per NIC:

#ps1

Set-Content C:\Windows\Temp\changeIP.ps1 "$IP = ("10.1.1.12","10.1.1.13","10.1.1.14") $NetMask = "255.0.0.0" $Gateway = "10.1.1.1" $Dns = "1.1.1.100" $IPType = "IPv4"

$adapter = Get-NetAdapter | ? {$_.Status -eq "up"}

If (($adapter | Get-NetIPConfiguration).IPv4Address.IPAddress) { $adapter | Remove-NetIPAddress -AddressFamily $IPType -Confirm:$false }

If (($adapter | Get-NetIPConfiguration).Ipv4DefaultGateway) { $adapter | Remove-NetRoute -AddressFamily $IPType -Confirm:$false }

ForEach ($address In $IP) { $ifName = $adapter.Name.ToString() If ($address -eq $IP[0]) { & netsh interface ipv4 add address "$ifName" $address $NetMask $Gateway } Else { & netsh interface ipv4 add address "$ifName" $address $NetMask } }

$adapter | Set-DnsClientServerAddress -ServerAddresses $DNS"

But the userdata execution doesn't work, and in the logs I receive the message "unsupported userdata format"

Any thoughts?