Hello,
I am working on a deployment script and trying to cover as many "bases" as possible. So I am wondering, after spending quiet a long time googleing, Is it possible to push install VMware tools for the first time to a Windows virtual machine that is not reachable over the network (it does not have an IP)
I found that I can update tools if they are "pre-installed" on a machine and I can mount the tools. But can I actually install them directly with PowerCLI without logging into the GUI?
Thank you for your help!
- Russ
That's a bit of a chicken and the egg problem.
You could consider using the Copy-VMGuestFile and Invoke-VMScript cmdlets, but they require VMware Tools to be installed :smileygrin:
There are a number of alternatives though:
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I have tried your advice of using GuiRunOnce, and it looks like it too requires VMWare tools..
I get the error message below:
set-vm : 6/1/2015 2:00:41 PM Set-VM Customization of the guest operating system 'windows7Server64Guest' is
not supported in this configuration. Microsoft Vista (TM) and Linux guests with Logical Volume Manager are supported
only for recent ESX host and VMware Tools versions. Refer to vCenter documentation for supported configurations.
At line:1 char:1
+ set-vm -vm TestDeploy -OSCustomizationSpec Windows
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-VM], UncustomizableGuest
+ FullyQualifiedErrorId : Client20_ClientSideTaskImpl_ThreadProc_UnhandledException,VMware.VimAutomation.ViCore.Cm
dlets.Commands.SetVM
Here is the customization I created....
New-OSCustomizationSpec -OrgName "OrgName" `
-FullName "FullName" `
-OSType Windows `
-Name Windows `
-Type Persistent `
-Domain "domain" `
-AdminPassword "password" `
-DomainUsername "creds" `
-DomainPassword password `
-GuiRunOnce "d:\setup64.exe"
set-vm -vm TestDeploy -OSCustomizationSpec Windows
also received:
new-vm : 6/1/2015 2:14:56 PM New-VM The operation for the entity "Template-W2K8R2" failed with the following
message: "Customization of the guest operating system 'windows7Server64Guest' is not supported in this configuration.
Microsoft Vista (TM) and Linux guests with Logical Volume Manager are supported only for recent ESX host and VMware
Tools versions. Refer to vCenter documentation for supported configurations."
At line:1 char:1
+ new-vm -Name Testing -Template Template-W2K8R2 -OSCustomizationSpec Windows -Con ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-VM], UncustomizableGuest
+ FullyQualifiedErrorId : Client20_TaskServiceImpl_CheckServerSideTaskUpdates_OperationFailed,VMware.VimAutomation
.ViCore.Cmdlets.Commands.NewVM
When trying to "Deply" a VM using the Oscustomizationspec...
Yes, of course, how could I have forgotten that requirement.
Let me think if there is another possible solution.
Are these VMs reachable over the network once they have been deployed and powered on ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Guess that is the Chicken and the egg part...
The VMs have no IP address and there is no DHCP server on that VLAN. I can easily powr them on and off via script.
If I can have the script set up the IP, I can connect to them to install the tools.
If I can have the script install the tools, i can connect to them and set up the IPs...
What if the VM is reachable by IP, but, i need to figure out the IP without logging onto the machine, is there a way to do that without VMWare tools?
Thanks
Would the name be registered in DNS ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
If it does, then i would need to save the entire DNS before and after for comparison and hope only 1 record was added during the deployment of a single VM... The host name is unknown and since no tools, it can't be set in advance...
Basically, I need a way to connect to the VM and either add tools or add "known" Ip or figure out the IP it was created with using a POWERCLI specifically. If one of the 3 is accomplished, then everything else is a cinch....
Thanks
When you deploy the new VM with an OSCustomizationSpec, then you can define a static IP address for the new VM.
See the New-OSCustomizationNicMapping cmdlet.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
yes :-).
But, if VMWare tools are not in the template, it won't customize...
so were at square one
Duh, keep forgetting that you have a template without VMware Tools.
Btw, is there a specific reason the template has no VMware Tools ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
not that i know... I started working on this script in our "lab" and learned it the hard way. Then i looked into the production environment, and found 3 out of 14 templates in there don't have tools either..
So even though the correct thing to do, is to just install the tools and re save the template, i figured why not take this possibility of one missing and build it into the script...
Instead, for now, i ended up building an exit routine instead, right after the actual creation...