HI
I'm trying to deploy Vms from a template and select a specific LUN from my datastore cluster. How can the code below be modified to accomplish this?
Thanks
$VMs = Get-Content "VmNames.txt"
$SourceTemp = "WIn2k08-R2"
$DsCluster = "DS-Cluster01"
$Folder = "Win2K08"
Foreach ($VM in $VMs) {
New-VM -Name $VMs -Template $SourceTemp -Datastore $DsCluster -Location $folder
}
Do you mean a specific datastore from that datastorecluster ?
If yes, you can just pass the datastorename on the Datastore parameter
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Do you mean a specific datastore from that datastorecluster ?
If yes, you can just pass the datastorename on the Datastore parameter
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yes I do mean a specific datastore from the datastore cluster but the datstores within the datastore clusters are not unique only the datastore cluster names within my environment. Can this still work?
How do you mean "not unique" ?
Then how do you select the datastore ?
Is that where the LUN comes in ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
If I understand you correctly do you mean to specify the datastore name and PowerCLI will know to find the datastore that I specify in the Datastore Cluster? For ex.
-Datastore -Name Datastore01
I mean one of the names that are returned by this
Get-DatastoreCluster -Name DS-Cluster01 | Get-Datastore | Select Name
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference