vmware-archive / rbvmomi

Ruby interface to the VMware vSphere API.
MIT License
302 stars 175 forks source link

Vmware Customization doesn't (seem to) pick up run-once commands #79

Open finkelamein opened 8 years ago

finkelamein commented 8 years ago

Coming from a problem noticed in foreman vpshere integration, through fog-vsphere, ending over here. See: https://github.com/fog/fog-vsphere/issues/37#issuecomment-224605166 http://projects.theforeman.org/issues/14979

The following hash get's passed from foreman, through fog-vsphere, but never makes it to the customization. (at least, it doesn't execute the commands, and no evidence of them is found in any of the run once parts in windows.

hash that get's passed to rbvmomi

{"customization_spec"=>{},
 "globalIPSettings"=>{"dnsServerList"=>["8.8.8.8"], "dnsSuffixList"=>["local.lan"]},
 "identity"=>
  {"Sysprep"=>
    {"guiRunOnce"=>nil,
     "commandList"=>
      ["%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -ExecutionPolicy Unrestricted -NoLogo -NoProfile -Command \"echo wood > C:\\test.txt\"",
       "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -ExecutionPolicy Unrestricted -NoLogo -NoProfile -Command \"(New-Object System.Net.WebClient).DownloadFile(\\\"http://yum.beheer.lan/windows/puppet/installpuppet.ps1\\\", \\\"c:\\installpuppet.ps1\\\")\"",
       "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -ExecutionPolicy Unrestricted -NoLogo -NoProfile -Command \"& \\\".\\installpuppet.ps1 -PuppetVersion 3.8.7-x64\\\"\"",
       "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -ExecutionPolicy Unrestricted -NoLogo -NoProfile -Command \"(New-Object System.Net.WebClient).DownloadFile(\\\"http://foreman.local.lan/unattended/built?token=\\\", \\\"c:\\foremaninstalled.txt\\\")\""],
     "guiUnattended"=>{"autoLogon"=>true, "autoLogonCount"=>1, "password"=>{"plainText"=>true, "value"=>"password"}, "timeZone"=>110},
     "identification"=>{"joinWorkgroup"=>"WORKGROUP"},
     "licenseFilePrintData"=>{"autoMode"=>"perSeat"},
     "userData"=>{"computerName"=>"w2k8r2-test", "fullName"=>"fullname", "orgName"=>"Organization", "productId"=>"Valid VLK license"}}},
 "nicSettingMap"=>
  [{"adapter"=>
     {"dnsDomain"=>"beheer.lan", "dnsServerList"=>["8.8.8.8"], "gateway"=>["1.2.3.4"], "ip"=>"1.2.3.5", "subnetMask"=>"255.255.255.0"}}],
 "options"=>{"changeSID"=>true, "deleteAccounts"=>"false`"}}

Any idea what's going on?

jrgarcia commented 8 years ago

So we meet again. 😄 I'm going to do a quick glance at all the PRs and issues and handle all the simple stuff now. I assure you I'll come back to this as soon as I've done a first pass.

jrgarcia commented 7 years ago

@finkelamein Sorry it took so long to get back to you. Is this still an issue? If so, I can take a look again. Just let me know whether I should close this or investigate. Thanks!

finkelamein commented 7 years ago

Hi, I'd guess it's still an issue, but I switched jobs since then, and I can't test this anymore for lack of both foreman and VMware farm.

Feel free to do with this as you want

On Mar 2, 2017 00:10, "J.R. Garcia" notifications@github.com wrote:

@finkelamein https://github.com/finkelamein Sorry it took so long to get back to you. Is this still an issue? If so, I can take a look again. Just let me know whether I should close this or investigate. Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vmware/rbvmomi/issues/79#issuecomment-283501783, or mute the thread https://github.com/notifications/unsubscribe-auth/AFsWkGApJ-W_vy0XmDVAWmaq3nDjV_8Hks5rhfrKgaJpZM4I1E8w .

MaartenMol commented 4 years ago

@finkelamein Sorry it took so long to get back to you. Is this still an issue? If so, I can take a look again. Just let me know whether I should close this or investigate. Thanks!

This is still an issue. I have just setup a fresh vCenter and Foreman. Trying to accomplish automatic provisioning of Windows VMs with Puppet agent. However, the commands are not ran anytime.