Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 231887

Re: How to Script making Linked Clones?

$
0
0

Sure, try something like this

 

$vmName="server01"
$snapName="Master"
$cloneName="cloned-$vmName"
$esxName="MyEsx"
$dsName="datastore1"

$vm=Get-VM-Name$vmName
if($vm.PowerState-eq"PoweredOff"){
 
Try {
   
$snap=Get-Snapshot-Name$snapName-VM$vm-ErrorActionStop
  }
 
Catch {
   
$snap=New-Snapshot-Name$snapName-VM$vm
  }
 
 
$cloneParams=@{
   
Name=$cloneName
   
VM=$vm
   
ReferenceSnapshot=$snap
   
LinkedClone=$true
   
VMHost=$esxName
   
Datastore=$dsName
  }
 
New-VM@cloneParams
}

Viewing all articles
Browse latest Browse all 231887

Trending Articles



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