Comments (5)
same issue here ..
from knife-vsphere.
any process on this, this is the only issue/reason why knife is not usable for me
from knife-vsphere.
I was able to accomplish the same task using rbvmomi and swapping out the CustomizationLinuxPrep for CustomizationSysprep. Presumably anybody could leverage the spec plugin feature of knife-vsphere to do the same work. The example below is from a script I wrote for this purpose, and not a direct plugin for knife-vsphere, but hopefully this gives you an example to work from
custom_spec = VIM.CustomizationSpec(
# linux uses globalIPSettings, but they might choke windows
:globalIPSettings => VIM.CustomizationGlobalIPSettings(
:dnsServerList => ["1.2.3.4", "5.6.7.8"],
:dnsSuffixList => ["blah.blahtest.com"] ),
:identity => VIM.CustomizationSysprep(
:guiRunOnce => VIM.CustomizationGuiRunOnce(
# you know what matters here? escaping backslashes. Learn from my failures.
:commandList => ["c:\\opscode\\chef\\bin\\chef-client.bat","shutdown /l"]
),
:guiUnattended => VIM.CustomizationGuiUnattended(
:autoLogon => true,
:autoLogonCount => 1,
:password => VIM.CustomizationPassword(
:value => "heyboo",
:plainText => true
),
# this should be the Arizona TZ
:timeZone => 015
),
:identification => VIM.CustomizationIdentification(
:domainAdmin => "domainadmin",
:domainAdminPassword => VIM.CustomizationPassword(
:value => "domainpass",
:plainText => true
),
:joinDomain => "blah.blahtest.com"
),
:userData => VIM.CustomizationUserData(
:computerName => VIM.CustomizationFixedName( :name => opts[:name].split('.').first ),
:fullName => "BigCorp Inc",
:orgName => "BigCorp Inc",
:productId => "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
),
),
:nicSettingMap => [ VIM.CustomizationAdapterMapping(
:adapter => VIM.CustomizationIPSettings(
:dnsDomain => "blah.blahtest.com",
:dnsServerList => [ "1.2.3.4", "5.6.7.8" ],
:gateway => [ opts[:ip].gsub(%r(\.\d+$), ".1") ],
:ip => VIM.CustomizationFixedIp( :ipAddress => opts[:ip] ),
:subnetMask => "255.255.255.0"
)
) ],
:options => VIM.CustomizationWinOptions(
:changeSID => true,
:deleteAccounts => false
)
)
Then that was pulled into the clone task via:
# combine all the above into one spec object for the cloning task
spec = VIM.VirtualMachineCloneSpec(:config => clone_spec, :location => relocateSpec, :customization => custom_spec, :powerOn => true, :template => false)
from knife-vsphere.
I put the short computer name in identity.userData.computerName.
To find the full list of options, refer to the vsphere VIM api:
But I also pass the FQDN as an option directly during the clone operation:
task = src_vm.CloneVM_Task(:folder => src_vm.parent.parent, :name =>
opts[:name], :spec => spec)
from knife-vsphere.
Closing as this seems to be solved. If not, please re-open or create a new issue.
from knife-vsphere.
Related Issues (20)
- Restoring Files of the VM in vCenter Level HOT 2
- Restoring files from the VM in vCenter level HOT 1
- Remove deprecated template_file and distro options HOT 3
- Setting a winrm_user in knife.rb breaks linux bootstrapping in certain cases
- Hostname is not assigned to the VM HOT 3
- upgrade ESX with chef HOT 2
- VM Migrate HOT 5
- knife vsphere vm execute fails with no program args HOT 1
- vm state --state suspended may not be suspending HOT 7
- Not able to run knife vsphere command HOT 16
- IP and hostname not assigned if using open-vm-tools HOT 4
- Dependabot can't parse your Gemfile
- knife vsphere vm vmdk add error HOT 1
- vm list recursive - bug! HOT 6
- knife-vsphere with SSL (knife ssl) help! HOT 1
- enhancing doc around resource pool settings w.r.t standalone managed esxi hosts HOT 2
- clone gives Exception: NameError: undefined local variable or method `connection' HOT 12
- Does "knife vsphere vm execute VMNAME COMMAND ARGS" work for Windows Guest?
- How to find the slowness on knife vsphere vm vmdk add? HOT 1
- Content Libraries
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knife-vsphere.