Quantcast
Channel: VMware Communities : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 176483

Deploy Linux VM from template with Guest Customization

$
0
0

Based on various forum postings and numerous articles i still haven't completely understood how to achieve the following scenario in a powercli script. any guidance is highly appreciated.

 

Scenario:

Linux Template - Name: LX-RHEL6x-template

GuestCustomSpec: - Name: static-lx-nw

 

Details:

Linux Template is pre-configured with required HDDs and network adapters. Customization Specs is preconfigured with all settings and expects IP address for adapter1 and adapter 2 is set to DHCP. I have to deploy about 50 VMs in multiple different environments and am trying to script this to ease my deployments.

 

deploy target:

Cluster Name: QA

Resource Pool: Normal

Datastore: StrgCluster01

 

Source:

CSV file containing following details.

VM-Name,IPADDR

 

So far i have following script info from one of the discussion thread here however i am not sure how i can achieve the above using this script or how to modify it as i already have netmask etc. predefined in the customspecs.

 

Import-Csv "C:\Uscripts\NewVMs.csv" -UseCulture | %{

 

    Get-OSCustomizationSpec $_.Customization | Get-OSCustomizationNicMapping | Set-OSCustomizationNicMapping -IpMode UseStaticIP -IpAddress $_.ip -SubnetMask $_.subnet -DefaultGateway $_.gw

 

    $vm=New-VM -Name $_.Name -Template $_.Template -Host $_.Host -Datastore $_.Datastore -Confirm:$false -RunAsync -OSCustomizationSpec $_.Customization

}


Viewing all articles
Browse latest Browse all 176483

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>