<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>homelab Archives - LucD notes</title>
	<atom:link href="https://www.lucd.info/category/homelab/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.lucd.info/category/homelab/</link>
	<description>My PowerShell ramblings</description>
	<lastBuildDate>Wed, 08 Apr 2020 10:55:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.9</generator>

<image>
	<url>https://www.lucd.info/wp-content/uploads/2018/12/cropped-120px-Tibetan_Dharmacakra-32x32.png</url>
	<title>homelab Archives - LucD notes</title>
	<link>https://www.lucd.info/category/homelab/</link>
	<width>32</width>
	<height>32</height>
</image> 
<atom:link rel="hub" href="https://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="https://pubsubhubbub.superfeedr.com"/><atom:link rel="hub" href="https://websubhub.com/hub"/>	<item>
		<title>Ravello PowerShell Module &#8211; Automating a Lab Setup</title>
		<link>https://www.lucd.info/2016/02/01/ravello-powershell-module-lab-setup/</link>
					<comments>https://www.lucd.info/2016/02/01/ravello-powershell-module-lab-setup/#comments</comments>
		
		<dc:creator><![CDATA[LucD]]></dc:creator>
		<pubDate>Mon, 01 Feb 2016 20:26:03 +0000</pubDate>
				<category><![CDATA[homelab]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Module]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Ravello]]></category>
		<category><![CDATA[v1.1.3.0]]></category>
		<category><![CDATA[Lab]]></category>
		<guid isPermaLink="false">http://www.lucd.info/?p=5101</guid>

					<description><![CDATA[On this blog you have recently seen a post about the Ravello PowerShell [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>On this blog you have recently seen a post about the <a href="https://www.lucd.info/2016/01/20/ravello-powershell-module-v1-1/" target="_blank">Ravello PowerShell module</a>, and another one showing some <a href="https://www.lucd.info/2016/01/26/ravello-powershell-module-examples/" target="_blank">Examples</a> on how to use that module.</p>
<p style="text-align: left;"><a href="https://www.lucd.info/2016/02/01/ravello-powershell-module-lab-setup/rav-lab/" rel="attachment wp-att-5102"><img decoding="async" class="size-full wp-image-5102 aligncenter" src="https://lucd.info/wp-content/uploads/2016/02/rav-lab.png" alt="rav-lab" width="349" height="141" srcset="https://www.lucd.info/wp-content/uploads/2016/02/rav-lab.png 349w, https://www.lucd.info/wp-content/uploads/2016/02/rav-lab-300x121.png 300w" sizes="(max-width: 349px) 100vw, 349px" /></a>I thought now would be a good time to show you one of my actual use cases. Discover how I deploy my main <strong>Lab</strong> in the <a href="https://www.ravellosystems.com/" target="_blank">Ravello</a> cloud without a single click, and each time exactly the way I want it.</p>
<p><span id="more-5101"></span></p>
<h1>The Concept</h1>
<p>Working in a <strong>(Home)Lab</strong> involves frequent re-installs, at least for me <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f644.png" alt="🙄" class="wp-smiley" style="height: 1em; max-height: 1em;" /> . I do tend to break stuff while experimenting. Hence my wish to automate a major part of these re-installs.</p>
<p>A second prerequisite was that I wanted to have an easy way to define what went into such a Lab. The definitions should be in an easy to read format that I could place under source control, think <a href="https://en.wikipedia.org/wiki/GitHub" target="_blank">GitHub</a>.</p>
<p>The <a href="https://www.ravellosystems.com/" target="_blank">Ravello cloud</a> is the ideal platform for a Lab, but it is missing the second requirement, a configuration file. To alleviate that problem, I started building a script based on my <a href="https://www.lucd.info/2016/01/20/ravello-powershell-module-v1-1/" target="_blank">Ravello PowerShell module</a>. And that script should be able to read the desired setup from a file, so I could construct the same Lab over and over, without any deviations. For the configuration file I decided to go for a <a href="https://en.wikipedia.org/wiki/JSON" target="_blank">JSON</a> file. My primary reasons for choosing JSON; easily readable and less fluffy than an <a href="https://en.wikipedia.org/wiki/XML" target="_blank">XML</a> file.</p>
<h1>The Configuration File</h1>
<p>This file has all the information required to build the Lab. The first part contains information about the Lab itself.</p>
<p>[js]<br />
&quot;Lab&quot;: [<br />
{<br />
  &quot;LabName&quot;:  &quot;Yggdrasil&quot;,<br />
  &quot;LabDescription&quot;:  &quot;vEng Test Environment&quot;,<br />
  &quot;Force&quot;:  &quot;true&quot;<br />
}<br />
],<br />
[/js]</p>
<p>There is a name and a description, and also a Force switch. If there is already an Application by the name, the Force switch will tell the script that this previous instance can be removed.</p>
<p>The second part has information on all the ISO files, or Disk Images in Ravello speak, that are required for the Lab. An extract</p>
<p>[js]<br />
&quot;Iso&quot;: [<br />
{<br />
  &quot;Label&quot;:  &quot;W2K12R2&quot;,<br />
  &quot;Filename&quot;:  &quot;en_windows_server_2012_r2_x64_dvd_2707946.iso&quot;,<br />
  &quot;Path&quot;:  &quot;R:\\Homelab\\MSDN\\W2K12R2U1&quot;<br />
},<br />
[/js]</p>
<p>This tells the script to upload the ISO file, if it is not already available in the Disk Image library. The name of the ISO file and the folder where it is stored are used by the Import-Ravello cmdlet. This Import-Ravello cmdlet is a wrapper around the Ravello Import CLI.</p>
<p>And lastly there is a number of VMs that need to be added to the Application.</p>
<p>[js]<br />
&quot;VM&quot;: [<br />
{<br />
  &quot;LabName&quot;:  &quot;Yggdrasil&quot;,<br />
  &quot;VmName&quot;:  &quot;DC1&quot;,<br />
  &quot;VmDescription&quot;:  &quot;Domain Controller&quot;,<br />
  &quot;Image&quot;:  &quot;Empty&quot;,<br />
  &quot;ISO&quot;:  &quot;W2K12R2&quot;,<br />
  &quot;NumCpu&quot;:  &quot;&quot;,<br />
  &quot;MemorySize&quot;:  &quot;&quot;,<br />
  &quot;MemoryUnit&quot;:  &quot;&quot;,<br />
  &quot;HD&quot;: [<br />
  {<br />
    &quot;HDSize&quot;: &quot;50&quot;,<br />
    &quot;HDUnit&quot;:  &quot;GB&quot;<br />
  }<br />
  ],<br />
  &quot;Hostname&quot;:  &quot;&quot;,<br />
  &quot;RDP&quot;:  &quot;true&quot;,<br />
  &quot;SSH&quot;:  &quot;false&quot;,<br />
  &quot;Order&quot;:  &quot;1&quot;,<br />
  &quot;OrderDelay&quot;:  &quot;300&quot;<br />
},<br />
[/js]</p>
<p>These VM entries in the JSON file contain quite a bit of information. There is the Image (Empty in the example) from which the VM shall be created, the ISO to connect to the VM, any additional Hard Disks, the Supplied Services, RDP and/or SSH, that shall be added, and so on.</p>
<p>Now that we have an idea about the JSON configuration file, let&#8217;s move on to the code that will do the magic.</p>
<h1>The Script</h1>
<p>The script contains three major parts:</p>
<ul>
<li>uploading of the required ISO files</li>
<li>create the Application in the Ravello cloud</li>
<li>populate the Application with a number of VMs.</li>
</ul>
<h2>Upload ISO Files</h2>
<p>The logic is rather straightforward. The script checks if there is already a Disk Image present with that name. If not, it will upload the ISO file to the Ravello Library as a Disk Image.</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag"># Upload ISOs
$lab.ISO | %{
  if(!(Get-RavelloDiskImage -DiskImageName $_.Filename))
  {
    Import-Ravello -IsoPath &quot;$($_.Path,$_.Filename -join '\')&quot; -Confirm:$false
    $doc = &quot;**$($_.Label)**: uploaded $(Get-Date -Format 'yyyyMMdd-hhmm') by $($env:USERNAME) from $($env:COMPUTERNAME)&quot;
    Get-RavelloDiskImage -DiskImageName $_.Filename | New-RavelloDiskImageDocumentation -Documentation $doc -Confirm:$false
  }
}</pre><p></p>
<p>Note how the code uses the new <strong>Documentation</strong> feature that was recently added to several objects in the Ravello cloud. This allows you to link some additional info to the resulting Disk Images.</p>
<p><a href="https://www.lucd.info/2016/02/01/ravello-powershell-module-lab-setup/iso-upload-documentation/" rel="attachment wp-att-5105"><img decoding="async" class="alignnone wp-image-5105 size-medium" src="https://lucd.info/wp-content/uploads/2016/02/ISO-upload-documentation-300x112.png" alt="ISO-upload-documentation" width="300" height="112" srcset="https://www.lucd.info/wp-content/uploads/2016/02/ISO-upload-documentation-300x112.png 300w, https://www.lucd.info/wp-content/uploads/2016/02/ISO-upload-documentation.png 507w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<h2>Create the Application &#8211; part 1</h2>
<p>The next step will create the Application in the Ravello cloud. There is some additional logic, which avoids overwriting an Application, unless the Force switch is used.</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">$lab.Lab | %{
$app = Get-RavelloApplication -ApplicationName $_.LabName

# Remove previous instance when Force
if($app -and [Convert]::ToBoolean($_.Force))
{
  Remove-RavelloApplication -ApplicationId $app.id -Confirm:$false
  $app = $null
  Write-Host 'Removed previous instance of application ' -NoNewline
  Write-Host -ForegroundColor Green &quot;$($_.LabName)&quot;
}

if(!$app)
{
  Write-Host 'Creating Application ' -NoNewline
  Write-Host -ForegroundColor Green &quot;$($_.LabName)&quot;

  $order = @()
  $sApp = @{
    ApplicationName = $_.LabName
    Description = $_.LabDescription
    Confirm = $false
  }
  $doc = &quot;**$($_.Labname)**: created on $(Get-Date -Format 'yyyyMMdd-hhmm') by $($env:USERNAME) from $($env:COMPUTERNAME)`r&quot;

# Create Application and add Documentation
  $app = New-RavelloApplication @sApp
  $app | New-RavelloApplicationDocumentation -Documentation $doc -Confirm:$false | Out-Null</pre><p></p>
<p>Some points to note in this part of the script:</p>
<ul>
<li>The JSON file can contain the information to create multiple Labs in one run, hence the loop over all the elements in the Lab array</li>
<li>JSON does not have a Boolean type, so we need to use the Convert function to convert the text string into a Boolean. Which we can then test in a conditional statement. See the interpretation of the Force switch</li>
<li>Note that I have a strong preference for splatting the cmdlet parameters. This makes, imho, your code more readable.</li>
<li>We attach Documentation to the Application</li>
</ul>
<h2>Adding VMs</h2>
<p>This is the part of the script where most of the work is done. There are a number of distinct parts.</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">$sAddVm = @{
  ApplicationId = $app.id
  ImageName = $_.Image
  NewVmName = $_.VmName
  NewVmDescription = $_.VmDescription
  Confirm = $false
}
$newLine = &quot;- **$($_.VmName)**: added to $($app.name) from $($_.Image)&quot; +
&quot; on $(Get-Date -Format 'yyyyMMdd-hhmm') by $($env:USERNAME) from $($env:COMPUTERNAME)&quot;
$doc = (Get-RavelloApplicationDocumentation -ApplicationId $app.id) + &quot;`r$($newLine)&quot;
Add-RavelloApplicationVm @sAddVm | Set-RavelloApplicationDocumentation -Documentation $doc -Confirm:$false | Out-Null</pre><p></p>
<p>The VM, based on an Image that is available in the Ravello Library, is created. The script adds a line about the VM creation to the Documentation that is attached to the Application. When the script completes, and the Application is created, this will provide information on what and when.</p>
<p><a href="https://www.lucd.info/2016/02/01/ravello-powershell-module-lab-setup/app-vm-doc/" rel="attachment wp-att-5106"><img fetchpriority="high" decoding="async" class="alignnone wp-image-5106 size-medium" src="https://lucd.info/wp-content/uploads/2016/02/app-vm-doc-300x188.png" alt="app-vm-doc" width="300" height="188" srcset="https://www.lucd.info/wp-content/uploads/2016/02/app-vm-doc-300x188.png 300w, https://www.lucd.info/wp-content/uploads/2016/02/app-vm-doc.png 568w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Once the VM is created, some adjustments will be applied. This includes CPU and Memory requirements, but also an update of the hostname that is present on the Empty Esx Image.</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag"># Adjust VM
if($_.NumCpu -or $_.MemorySize -or $_.Hostname)
{
  $sVM = @{
    ApplicationId = $app.id
    VmName = $_.VmName
    Confirm = $false
  }
  if($_.NumCpu)
  {
    $sVM.Add('NumCpu',$_.NumCpu)
  }
  if($_.MemorySize)
  {
    $sVM.Add('MemorySize',$_.MemorySize)
    $sVM.Add('MemorySizeUnit',$_.MemoryUnit)
  }
  if($_.Hostname)
  {
    $sVM.Add('Hostnames',$_.Hostname)
  }
  Set-RavelloApplicationVm @sVM | Out-Null
}</pre><p></p>
<p>This part of the script uses the new <strong>Set-RavelloApplicationVm</strong> parameters, that were introduced in v1.1.2.6 of the Ravello PowerShell module.</p>
<p>A quick side note here, the Ravello PowerShell module is available on the <a href="https://www.powershellgallery.com/">PowerShell Gallery</a>. Make sure to use the latest version.</p>
<p><a href="https://www.lucd.info/2016/02/01/ravello-powershell-module-lab-setup/ps-gallery/" rel="attachment wp-att-5107"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-5107" src="https://lucd.info/wp-content/uploads/2016/02/ps-gallery.png" alt="ps-gallery" width="843" height="85" srcset="https://www.lucd.info/wp-content/uploads/2016/02/ps-gallery.png 843w, https://www.lucd.info/wp-content/uploads/2016/02/ps-gallery-300x30.png 300w, https://www.lucd.info/wp-content/uploads/2016/02/ps-gallery-768x77.png 768w" sizes="auto, (max-width: 843px) 100vw, 843px" /></a></p>
<p>Continuing with the script, it will now check if additional Hard Disks for the VM are required. If yes, it will update the VM accordingly. The <strong>Set-RavelloApplicationVmDisk</strong> cmdlet was introduced in <strong>v1.1.3.0</strong></p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag"># Additional HD on VM
if($_.HD)
{
  foreach($hd in $_.HD){
    $sVM = @{
      ApplicationId = $app.id
      VmName = $_.VmName
      Confirm = $false
      DiskSize = $hd.HDSize
      DiskSizeUnit = $hd.HDUnit
    }
    Set-RavelloApplicationVmDisk @sVM | Out-Null
  }
}</pre><p></p>
<p>Next step will add/remove the selected Supplied Services RDP and SSH.</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag"># Add/Remove Services
if($_.RDP -or $_.SSH)
{
  $sVM = @{
    ApplicationId = $app.id
    VmName = $_.VmName
    Confirm = $false
  }
  if($_.RDP)
  {$sVM.Add('Rdp',[Convert]::ToBoolean($_.RDP))}
  if($_.SSH)
  {$sVM.Add('Ssh',[Convert]::ToBoolean($_.SSH))}
  Set-RavelloApplicationVmService @sVM | Out-Null
}</pre><p></p>
<p>This part of the code is a bit tricky, since the cmdlet uses a Switch for both Supplied Services. The rule I coded, if the Switch is not present, no action will be taken.</p>
<p>If the Switch is present, it will check if the Supplied Service needs to be added ($True) or removed ($false).</p>
<p>This uses the <strong>Set-RavelloApplicationVmService cmdlet</strong> which was introduced in <strong>v1.1.3.0</strong>.</p>
<p>The final part for the VM creation is connecting the correct ISO file. Nothing special about this, it uses the <strong>Set-RavelloApplicationVmIso</strong> cmdlet.</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag"># Connect the ISO
$sIso = @{
  ApplicationId = $app.id
  VmName = $_.VmName
  DiskImageName = &amp;{
  foreach($iso in $lab.ISO){
    if($iso.Label -eq $_.ISO){$iso.FileName}
  }}
  Confirm = $false
}
Set-RavelloApplicationVmIso @sIso | Out-Null</pre><p></p>
<h2>Create the Application &#8211; part 2</h2>
<p>&nbsp;</p>
<p>Once all the required VMs have been added to the Application, the script needs to &#8220;<strong>Publish</strong>&#8221; the Application. This is the location where you can specify if the Application should be Cost or Performance optimised.</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag"># Publish the Application
if(!(Test-RavelloApplicationPublished -ApplicationName $_.Labname))
{
  Publish-RavelloApplication -ApplicationName $_.Labname -OptimizationLevel PERFORMANCE_OPTIMIZED -Confirm:$false | Out-Null
}</pre><p></p>
<p><a href="https://www.lucd.info/2016/02/01/ravello-powershell-module-lab-setup/app-cost-perf/" rel="attachment wp-att-5108"><img loading="lazy" decoding="async" class="alignnone wp-image-5108 size-medium" src="https://lucd.info/wp-content/uploads/2016/02/app-cost-perf-300x104.png" alt="app-cost-perf" width="300" height="104" srcset="https://www.lucd.info/wp-content/uploads/2016/02/app-cost-perf-300x104.png 300w, https://www.lucd.info/wp-content/uploads/2016/02/app-cost-perf.png 635w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>One last step, the script needs to define the <strong>Start Order</strong> of the VMs.</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag"># Set the start order
$order = $order | Group-Object -Property Group | Sort-Object -Property Name | %{
  New-Object PSObject -Property @{
    Name = &quot;Group$($_.Group[0].Group)&quot;
    DelaySeconds = $_.Group[0].Delay
    VM = $_.Group | Select-Object -ExpandProperty VM
  }
}
New-RavelloApplicationOrderGroup -ApplicationId $app.id -StartOrder $order | Out-Null</pre><p></p>
<p>This results in a <strong>Start Order</strong> for the VMs in the Application.</p>
<p><a href="https://www.lucd.info/2016/02/01/ravello-powershell-module-lab-setup/app-start/" rel="attachment wp-att-5109"><img loading="lazy" decoding="async" class="alignnone wp-image-5109 size-medium" src="https://lucd.info/wp-content/uploads/2016/02/app-start-300x226.png" alt="app-start" width="300" height="226" srcset="https://www.lucd.info/wp-content/uploads/2016/02/app-start-300x226.png 300w, https://www.lucd.info/wp-content/uploads/2016/02/app-start.png 598w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>This completes the overview of the Lab creation script I have been creating last weekend.</p>
<p><a href="https://www.lucd.info/2016/02/01/ravello-powershell-module-lab-setup/app-vm/" rel="attachment wp-att-5112"><img loading="lazy" decoding="async" class="alignnone wp-image-5112 size-medium" src="https://lucd.info/wp-content/uploads/2016/02/app-vm-300x161.png" alt="app-vm" width="300" height="161" srcset="https://www.lucd.info/wp-content/uploads/2016/02/app-vm-300x161.png 300w, https://www.lucd.info/wp-content/uploads/2016/02/app-vm-768x413.png 768w, https://www.lucd.info/wp-content/uploads/2016/02/app-vm.png 930w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>It creates my Lab, exactly as I want it, without any mouse clicks. And that in under 1 minute!</p>
<p><a href="https://www.lucd.info/2016/02/01/ravello-powershell-module-lab-setup/lab-creation/" rel="attachment wp-att-5110"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-5110" src="https://lucd.info/wp-content/uploads/2016/02/lab-creation.png" alt="lab-creation" width="464" height="224" srcset="https://www.lucd.info/wp-content/uploads/2016/02/lab-creation.png 464w, https://www.lucd.info/wp-content/uploads/2016/02/lab-creation-300x145.png 300w" sizes="auto, (max-width: 464px) 100vw, 464px" /></a></p>
<p>The <a href="https://github.com/lucdekens/Scripts/blob/master/Create-Lab-Public.ps1" target="_blank">PS1 script</a> and a <a href="https://github.com/lucdekens/Scripts/blob/master/yggdrasil.json" target="_blank">sample JSON</a> file are available on my <a href="https://github.com/lucdekens/Scripts" target="_blank">Scripts</a> repository.</p>
<p>Please feel free to send questions,  remarks, issues and suggestions.</p>
<p>Enjoy!</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.lucd.info/2016/02/01/ravello-powershell-module-lab-setup/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>HL Tools &#8211; Part 2 &#8211; Create a Nested Hypervisor</title>
		<link>https://www.lucd.info/2013/07/12/hl-tools-part-2-create-a-nested-hypervisor/</link>
					<comments>https://www.lucd.info/2013/07/12/hl-tools-part-2-create-a-nested-hypervisor/#comments</comments>
		
		<dc:creator><![CDATA[LucD]]></dc:creator>
		<pubDate>Fri, 12 Jul 2013 21:07:26 +0000</pubDate>
				<category><![CDATA[ESXi]]></category>
		<category><![CDATA[homelab]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[hyper-v]]></category>
		<category><![CDATA[nested]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<guid isPermaLink="false">http://www.lucd.info/?p=4513</guid>

					<description><![CDATA[During last year&#8217;s VMworld #NotSupported sessions one of the hot topics was William [&#8230;]]]></description>
										<content:encoded><![CDATA[<p style="text-align: left;">During last year&#8217;s VMworld <a href="https://www.virtuallyghetto.com/2012/08/notsupported-sessions-at-vmworld-2012.html" target="_blank" rel="noopener noreferrer">#NotSupported sessions</a> one of the hot topics was <a href="https://twitter.com/lamw" target="_blank" rel="noopener noreferrer">William Lam</a>&#8216;s <a href="https://www.virtuallyghetto.com/2012/09/vinception-notsupported-slides-posted.html" target="_blank" rel="noopener noreferrer">vInception</a> talk. &#8220;<em>Nested ESXi</em>&#8221; has since then become indispensable in the homelab of everyone tinkering with virtualisation !</p>
<p style="text-align: left;">As a follow-up to that session, <a href="https://twitter.com/lamw" target="_blank" rel="noopener noreferrer">William</a> posted several blog posts on the subject. You can find them all in a <a href="https://www.virtuallyghetto.com/2012/10/nested-virtualization-resources.html" target="_blank" rel="noopener noreferrer">handy overview</a>.</p>
<p style="text-align: left; padding-left: 90px;"><a href="https://www.lucd.info/2013/07/12/hl-tools-part-2-create-a-nested-hypervisor/nested-esxi-sierpinski/" rel="attachment wp-att-4520"><img loading="lazy" decoding="async" class="alignnone  wp-image-4520" alt="nested-esxi-sierpinski" src="https://lucd.info/wp-content/uploads/2013/07/nested-esxi-sierpinski.png" width="329" height="291" srcset="https://www.lucd.info/wp-content/uploads/2013/07/nested-esxi-sierpinski.png 522w, https://www.lucd.info/wp-content/uploads/2013/07/nested-esxi-sierpinski-300x265.png 300w" sizes="auto, (max-width: 329px) 100vw, 329px" /></a></p>
<p style="text-align: left;">But as much as I like his clear instructions on how to set up nested ESXi, I wanted to automate the process <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> In my homelab I create, and remove, ESXi VMs on a regular basis. So with the &#8220;<em>If you do it more than once, automate it</em>&#8221; in mind, I decided to create a function for the process.</p>
<p style="text-align: left;"><span id="more-4513"></span></p>
<h2 style="text-align: left;">The Script</h2>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">function New-NestedHypervisor {
&lt;#  
.SYNOPSIS  Create a nested hypervisor   
.DESCRIPTION The function will create a VM that is
  configured to run a nested hypervisor
.NOTES  Author:  Luc Dekens  
.PARAMETER Name
  The name of the VM that will be created
.PARAMETER VMHost
  The ESXi server where the VM shall be created
.PARAMETER DiskGB
  The size of the virtual disk assigned to the VM
.PARAMETER NumCpu
  The number of vCPU allocated to the VM
.PARAMETER MemoryGB
  The amount of memory to be allocated to the VM
.PARAMETER Portgroup
  An array of VirtualPortgroupBase objects. For each 
  entry a NIC will be assigned to the VM, and it will
  be connected to the portgroup
.PARAMETER CD
  A switch to define if a CD/DVD shall be created on
  the VM
.PARAMETER ISOPath
  If a CD is allocated to the VM, this variable allows to specify
  an ISO file that will be connected.
.PARAMETER ESXi
  A switch indicating if the VM shall be configured for a nested
  ESXi hypervisor
.PARAMETER HyperV
  A switch indicating if the VM shall be configured for a nested
  Hyper-V hypervisor
.PARAMETER Force
  If a VM with the same Name already exists then setting this
  switch to $True will remove it before creating the new VM.
.EXAMPLE
  PS&gt; New-NestedHypervisor @splattedParameters
#&gt;

  [CmdletBinding(DefaultParameterSetName = &quot;ESXi&quot;)]
  Param(
    [Parameter(Mandatory=$true)]
    [string]$Name,
    [PSObject]$VMHost,
    [int]$DiskGB,
    [int]$NumCpu,
    [int]$MemoryGB,
    [VMware.VimAutomation.ViCore.Impl.V1.Host.Networking.VirtualPortGroupImpl[]]$Portgroup,
    [switch]$CD,
    [string]$ISOPath,
    [Parameter(Mandatory=$true,ParameterSetName = &quot;ESXi&quot;)]
    [switch]$ESXi,
    [Parameter(Mandatory=$true,ParameterSetName = &quot;Hyper-V&quot;)]
    [switch]$HyperV,
    [switch]$Force
  )

  process {
    # Simple VMHost OBN
    if($VMHost -is [System.String]){
      try {
        $VMHost = Get-VMHost -Name $VMHost
      }
      catch {
        Write-Error &quot;Invalid hostname $VMHost&quot;
        return
      }
    }

    # Check this is on a ESXi 5.1 ESXi
    if($VMHost.ApiVersion -ne &quot;5.1&quot;){
      Write-Error &quot;Host $($VMHost).Name doesn't seem to be an ESXi 5.1&quot;
      return
    }
    
    # Check if nested hypervisor is allowed
    if(!$VMHost.ExtensionData.Capability.NestedHVSupported){
      Write-Error &quot;Host $($VMHost).Name doesn't seem to support HVT&quot;
      return
    }

    # Check if the VM already exists. If yes, remove it
    $hv = Get-VM -Name $Name -ErrorAction SilentlyContinue
    if($hv){
      if($Force){
        if($hv.PowerState -eq &quot;PoweredOn&quot;){
          Stop-VM -VM $hv -Confirm:$false
        }
        Remove-VM -VM $hv -DeletePermanently -Confirm:$false
      }
      else{
        Write-Error &quot;There is already a VM called $Name present&quot;
        return
      }
    }

    # Create the VM
    $osId = &quot;vmkernel5Guest&quot;
    if($HyperV){
      $osId = &quot;windows8Server64Guest&quot;
    }
    $hvParams = @{
      Name = $Name
      VMHost = $VMHost
      GuestId = $osId
      Version = &quot;v9&quot;
      DiskGB = $DiskGB
      NumCpu = $NumCpu
      MemoryGB = $MemoryGB
      Portgroup = $Portgroup
      CD = $CD
    }
    $hv = New-VM @hvParams

    # Boot order (CD) &amp; nested enabled 
    $spec = New-Object VMware.Vim.VirtualMachineConfigSpec
    if($CD){
      $spec.BootOptions = New-Object VMware.Vim.VirtualMachineBootOptions
      $spec.BootOptions.bootOrder += New-Object VMware.Vim.VirtualMachineBootOptionsBootableCdromDevice
    }
    $spec.nestedHVEnabled = $true
    if($HyperV){
      $vmxEntry = New-Object VMware.Vim.OptionValue
      $vmxEntry.Key = &quot;hypervisor.cpuid.v0&quot;
      $vmxEntry.Value = &quot;FALSE&quot;
      $spec.ExtraConfig += $vmxEntry
    }

    try {
      $hv.ExtensionData.ReconfigVM($spec)
    }
    catch {
      &quot;Reconfig failed&quot;
      return
    }

    # Mount the ISO
    if($CD -and $ISOPath){
      Get-CDDrive -VM $hv | 
      Set-CDDrive -IsoPath $ISOPath -StartConnected $true -Confirm:$false |
      Out-Null
    }
 
    # Return the newly created VM
    Get-VM -Name $Name
  }
}</pre><p></p>
<h4 style="text-align: left;">Annotations</h4>
<p><strong>Line 60-68</strong>: A rather simple implementation of the <a href="https://www.vmware.com/support/developer/PowerCLI/PowerCLI51R2/html/about_obn.html" target="_blank" rel="noopener noreferrer">Object By Name</a> concept for the VMHost parameter.</p>
<p><strong>Line 71-74</strong>: A test to verify that the function is running against an <strong>ESXi 5.1</strong>. Note that the function doesn&#8217;t test on &#8220;<em>5.1 or higher</em>&#8220;, the reason is that the concept in a future ESXi build may change.</p>
<p><strong>Line 77-80</strong>: The function verifies that the ESXi server passed in VMHost supports <a href="http://www.vmware.com/files/pdf/VMware_paravirtualization.pdf" target="_blank" rel="noopener noreferrer">Virtual Hardware-Assisted Virtualization</a> (<strong>VHV</strong>).</p>
<p><strong>Line 83-95</strong>: When a VM with the same <strong>Name</strong> already exists, the function will return unless the <strong>Force</strong> parameter is used.</p>
<p><strong>Line 98</strong>: Contrary to the procedure to be used with the Web Client, we can immediately select the ESXi <strong>guestId</strong>.</p>
<p><strong>Line 102-111</strong>: The &#8220;<em>splatted</em>&#8221; <a href="https://www.vmware.com/support/developer/PowerCLI/PowerCLI51R2/html/New-VM.html" target="_blank" rel="noopener noreferrer">New-VM</a> parameters</p>
<p><strong>Line 116-119</strong>: If the <strong>CD</strong> switch was set to $True, the function will set the VM to boot from the CD/DVD.</p>
<p><strong>Line 121-126</strong>: In case the <strong>HyperV</strong> switch was set to $True, the function needs to add the &#8220;<em>hypervisor.cpuid.vo = FALSE</em>&#8221; entry to the VMX file.</p>
<p><strong>Line 137-141</strong>: If the <strong>CD</strong> switch was set to $True and an <strong>ISOPath</strong> was given, the function will connect the CD/DVD drive to the ISO.</p>
<h2>Sample Usage</h2>
<p>With the function you can now automate the creation of a number of nested hypervisors on your homelab server.</p>
<p>In the following example I create 3 VMs that will run <strong>nested ESXi</strong> hypervisors.</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">$esx = Get-VMHost -Name MyLab
$pgName = &quot;Internal&quot;
$pgObj = Get-VirtualPortGroup -Name $pgName
$pg = 1..4 | %{$pgObj}

$nestedParams = @{
  Name = $null
  VMHost = $esx
  DiskGB = 8
  NumCpu = 2
  MemoryGB = 8
  Portgroup = $pg
  CD = $true
  ISOPath = &quot;[datastore1] ISO/VMware-VMvisor-Installer-5.1.0-799733.x86_64.iso&quot;
  ESXi = $true
}

1..3 | %{
  $nestedParams.Name = &quot;ESX$($_)&quot;
  $newesx = New-NestedHypervisor @nestedParams
  Start-VM -VM $newesx -Confirm:$false
}</pre><p></p>
<p>In a bit more than 1 minute my 3 nested ESXi VMs have been created, and are ready to be installed. Hardly enough time to get me a decent Belgian beer from the fridge <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p><a href="https://www.lucd.info/2013/07/12/hl-tools-part-2-create-a-nested-hypervisor/hv-nested-events/" rel="attachment wp-att-4517"><img loading="lazy" decoding="async" class="alignnone  wp-image-4517" alt="hv-nested-events" src="https://lucd.info/wp-content/uploads/2013/07/hv-nested-events.png" width="478" height="211" srcset="https://www.lucd.info/wp-content/uploads/2013/07/hv-nested-events.png 796w, https://www.lucd.info/wp-content/uploads/2013/07/hv-nested-events-300x132.png 300w" sizes="auto, (max-width: 478px) 100vw, 478px" /></a></p>
<p>And the same can of course be done for the creation of a nested <strong>Hyper-V</strong> hypervisor.</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">$esx = Get-VMHost -Name MyLab
$pgName = &quot;Internal&quot;
$pgObj = Get-VirtualPortGroup -Name $pgName
$pg = 1..4 | %{$pgObj}

$nestedParams = @{
  Name = &quot;HV1&quot;
  VMHost = $esx
  DiskGB = 8
  NumCpu = 2
  MemoryGB = 8
  Portgroup = $pg
  CD = $false
  HyperV = $true
}

$hv1 = New-NestedHypervisor @nestedParams</pre><p></p>
<p style="text-align: left;">Enjoy !</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.lucd.info/2013/07/12/hl-tools-part-2-create-a-nested-hypervisor/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>HL Tools &#8211; Part 1 &#8211; Clone a VM without vCenter</title>
		<link>https://www.lucd.info/2013/06/30/hl-tools-part-1-clone-a-vm-without-vcenter/</link>
					<comments>https://www.lucd.info/2013/06/30/hl-tools-part-1-clone-a-vm-without-vcenter/#comments</comments>
		
		<dc:creator><![CDATA[LucD]]></dc:creator>
		<pubDate>Sun, 30 Jun 2013 15:05:55 +0000</pubDate>
				<category><![CDATA[homelab]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[clone]]></category>
		<category><![CDATA[ESXi]]></category>
		<guid isPermaLink="false">http://www.lucd.info/?p=4489</guid>

					<description><![CDATA[In my homelab I try to automate as much as possible. I have [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In my homelab I try to automate as much as possible. I have a number of scripts and functions that help me setting up test environments in my homelab.  Since I got quite a number of requests on this, I decided to start a series on my homelab tools.</p>
<p>One of the tasks I automated is the provisioning of VMs. Quite easy when you have a <strong>vCenter</strong> that manages the cloning process. But in <strong>layer 1</strong> of my homelab I&#8217;m running ESXi standalone on a PaaS provided server, so no vCenter.</p>
<p>With the <a href="https://www.vmware.com/support/developer/PowerCLI/PowerCLI51R2/html/Copy-DatastoreItem.html" target="_blank">Copy-DatastoreItem</a> cmdlet it is easy to clone the files of a VM, but this kind of copy doesn&#8217;t know about the different types of <a href="https://pubs.vmware.com/vsphere-51/topic/com.vmware.wssdk.apiref.doc/vim.vm.device.VirtualDisk.html" target="_blank">VirtualDisk</a> you can have in a VM. As a result, your <strong>Thin</strong> vdisks become <strong>Thick</strong> vDisks in the clone. The function in this post avoids that problem by using the <a href="https://pubs.vmware.com/vsphere-51/topic/com.vmware.wssdk.apiref.doc/vim.VirtualDiskManager.html" target="_blank">VirtualDiskManager</a> for copying the VMDK.</p>
<p style="padding-left: 60px;"><a href="https://www.lucd.info/2013/06/30/hl-tools-part-1-clone-a-vm-without-vcenter/clone-vm-no-vc/" rel="attachment wp-att-4491"><img loading="lazy" decoding="async" class="alignnone  wp-image-4491" alt="clone-vm-no-vc" src="https://lucd.info/wp-content/uploads/2013/06/clone-vm-no-vc.png" width="355" height="294" srcset="https://www.lucd.info/wp-content/uploads/2013/06/clone-vm-no-vc.png 444w, https://www.lucd.info/wp-content/uploads/2013/06/clone-vm-no-vc-300x248.png 300w" sizes="auto, (max-width: 355px) 100vw, 355px" /></a></p>
<p>Note that there are a couple of prerequisites: the master VM needs to be <strong>powered off</strong> and have <strong>no snapshots</strong>. And till now I only tested this with VMs that run a Windows guest OS.</p>
<p><span id="more-4489"></span></p>
<h2>The Script</h2>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">function Clone-MasterVM {
&lt;#  
.SYNOPSIS  Clone a VM without using vCenter   
.DESCRIPTION The function will clone a VM to a
  specified datastore. Optionally the new VM will be
  registered and powered on.
.NOTES  Author:  Luc Dekens  
.PARAMETER MasterName
  The name of the VM that will be cloned
.PARAMETER CloneName
  The name of the VM that is cloned
.PARAMETER DatastoreName
  The name of the datastore where the clone will be
  stored
.PARAMETER Register
  Register the clone on the vSphere server
.PARAMETER PowerOn
  Power on the clone. Can only be used when the Register
  switch is selected.
.EXAMPLE
  PS&gt; Clone-MasterVM -MasterName M1 -CloneName Srv1 -DatastoreName DS1
#&gt;

  param(
  [string]$MasterName,
  [string]$CloneName,
  [string]$DatastoreName,
  [switch]$Register,
  [switch]$PowerOn
  )
  
  $vm = Get-VM -Name $MasterName
  if($vm.ExtensionData.Snapshot -or $vm.PowerState -eq &quot;PoweredOn&quot;){
    Write-Error &quot;The VM should be powered off and have no snapshots&quot;
    return
  }
  
  $si = Get-View ServiceInstance
  $vdkMgr = Get-View $si.Content.virtualDiskManager
  $fileMgr = Get-View $si.Content.FileManager
  
  $dcMoRef = (Get-Datacenter -VM $vm).ExtensionData.MoRef
  $srcDSName = $vm.ExtensionData.Config.Files.VmPathName.Split(']')[0].Trim('[')
  $srcDS = Get-Datastore -Name $srcDSName
  $srcDSBrowser = Get-View $srcDS.ExtensionData.Browser
  $tgtDS = Get-Datastore -Name $DatastoreName
  $spec = New-Object VMware.Vim.HostDatastoreBrowserSearchSpec
  
  # Create folder for new VM
  $fileMgr.MakeDirectory(&quot;[$DatastoreName] $CloneName&quot;,$dcMoRef,$false)

  # Copy vDisks
  $spec.Query = New-Object VMware.Vim.VmDiskFileQuery
  $qResult = $srcDSBrowser.SearchDatastore(&quot;[$srcDSName] $MasterName&quot;,$spec)
  if($qResult.File){
    $qResult.File | %{
      $srcPath = &quot;$($qResult.FolderPath)/$($_.Path)&quot;
      $tgtPath = $srcPath.Replace($srcDSName,$DatastoreName).Replace($MasterName,$CloneName)
      $hd = $vm.ExtensionData.Config.Hardware.Device |
        where {$_ -is [VMware.Vim.VirtualDisk] -and $_.Backing.FileName -eq $srcPath}
      $controller = $vm.ExtensionData.Config.Hardware.Device |
        where {$_.Key -eq $hd.ControllerKey}
      $vDiskSpec = New-Object VMware.Vim.VirtualDiskSpec
      $vDiskSpec.adapterType = &amp;{
        if($controller -is [VMware.Vim.VirtualLsiLogicController] -or
          $controller -is [VMware.Vim.VirtualLsiLogicSASController] -or
          $controller -is [VMware.Vim.ParaVirtualSCSIController]){
          [VMware.Vim.VirtualDiskAdapterType]::lsiLogic
        }
        elseif($controller -is [VMware.Vim.VirtualBusLogicController]){
          [VMware.Vim.VirtualDiskAdapterType]::busLogic
        }
        else{
          [VMware.Vim.VirtualDiskAdapterType]::ide
        }
      }
      $vDiskSpec.diskType = &amp;{
        if($hd.Backing.eagerlyScrub){[VMware.Vim.VirtualDiskType]::eagerZeroedThick}
        elseif($hd.Backing.thinProvisioned){[VMware.Vim.VirtualDiskType]::thin}
        else{[VMware.Vim.VirtualDiskType]::thick}}
      $vdkMgr.CopyVirtualDisk($srcPath,$dcMoRef,$tgtPath,$dcMoRef,$vDiskSpec,$null)
    }
  }

  # Copy other VM files
  $dsDestination = New-PSDrive -Location $tgtDS -Name dest -PSProvider VimDatastore -Root '\'
  Get-ChildItem -Path &quot;vmstore:\ha-datacenter\$srcDSName\$MasterName&quot; |
  where {&quot;vmdk&quot;,&quot;log&quot;,&quot;vmsd&quot; -notcontains $_.Name.Split('.')[1]} | %{
  # The copy is done in a foreach loop, to bypass a Copy-DatastoreItem bug with pipeline
  Copy-DatastoreItem -Item $_ `
     -Destination (&quot;dest:\$CloneName\&quot; + $_.Name.Replace($MasterName,$CloneName)) -Confirm:$false
  }

  # Update VMX file
  Copy-DatastoreItem -Item &quot;dest:\$CloneName\$($CloneName).vmx&quot; -Destination $env:Temp\t.vmx
  $text = Get-Content -Path $env:Temp\t.vmx | %{$_.Replace($MasterName,$CloneName)}
  $text | Set-Content -Path $env:Temp\t.vmx
  Copy-DatastoreItem -Item $env:Temp\t.vmx -Destination &quot;dest:\$CloneName\$($CloneName).vmx&quot; -Confirm:$false

  # Update VMXF file
  Copy-DatastoreItem -Item &quot;dest:\$CloneName\$($CloneName).vmxf&quot; -Destination $env:Temp\t.vmxf
  $text = Get-Content -Path $env:Temp\t.vmxf | %{$_.Replace($MasterName,$CloneName)}
  $text | Set-Content -Path $env:Temp\t.vmxf
  Copy-DatastoreItem -Item $env:Temp\t.vmxf -Destination &quot;dest:\$CloneName\$($CloneName).vmxf&quot; -Confirm:$false
  
  if($Register){
    New-VM -VMFilePath &quot;[$DatastoreName] $CloneName\$($CloneName).vmx&quot; | Out-Null
    if($PowerOn){
      Start-VM -VM $CloneName -ErrorAction SilentlyContinue
      Get-VMQuestion -VM $CloneName | Set-VMQuestion -DefaultOption -Confirm:$false
    }
  }

  Remove-PSDrive -Name dest -Confirm:$false
}</pre><p></p>
<h4>Annotations</h4>
<p><strong>Line 24-30</strong>: The definition of the parameters for the function. Note that the function doesn&#8217;t use any of the advanced features, nor pipeline input. Since I use this function in my homelab, I found functionality more important than good coding style <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> And the function name itself doesn&#8217;t comply with the approved verbs either.</p>
<p><strong>Line 33-36</strong>: The function tests if the master VM is powered on or has snapshots. In that case the function returns immediately. It seems that copying a VM that has snapshots, can have an impact on the functioning of the cloned VM (see <a href="https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&amp;cmd=displayKC&amp;externalId=1000936" target="_blank">KB1000936</a>).</p>
<p><strong>Line 38-40</strong>: Get the managers via the <a href="https://pubs.vmware.com/vsphere-51/topic/com.vmware.wssdk.apiref.doc/vim.ServiceInstance.html" target="_blank">ServiceInstance</a>. Remember, no vCenter !</p>
<p><strong>Line 42-46</strong>: Retrieve and/or compose the values that are required later in the function.</p>
<p><strong>Line 50</strong>: Create the datastore folder that will hold the cloned VM</p>
<p><strong>Line 47,53-54</strong>: The function uses the <a href="https://pubs.vmware.com/vsphere-51/topic/com.vmware.wssdk.apiref.doc/vim.host.DatastoreBrowser.html#searchSubFolders" target="_blank">HostDatastoreBrowser</a> to find all VMDK files.</p>
<p><strong>Line 59-80</strong>: These lines make sure that the VirtualDisk type of each vDisk in the master VM, is also used in the corresponding vDisk in the cloned VM.</p>
<p><strong>Line 81</strong>: The actual copy of the vDisk from the master to the clone.</p>
<p><strong>Line 88</strong>: There is no need to copy the <strong>.vmdk</strong> (already done), the <strong>.log</strong> and the <strong>.vmsd</strong> (no snapshots remember) files to the clone.</p>
<p><strong>Line 89</strong>: It seems that some PowerCLI builds have a problem when the Item object is passed over the pipeline to the <a href="https://www.vmware.com/support/developer/PowerCLI/PowerCLI51R2/html/Copy-DatastoreItem.html" target="_blank">Copy-DatastoreItem</a> cmdlet. To bypass this problem, the function uses a <strong>ForEach</strong> loop and specifies the Item object on the cmdlet explicitly.</p>
<p><strong>Line 95,101</strong>: To update the <strong>.vmx</strong> and<strong> .vmxf</strong> files, the function copies both files to a Temp folder on the station where the script is running. This is to bypass the &#8220;<em>cannot open file</em>&#8221; problem when updating a file in place.</p>
<p><strong>Line 110</strong>: The ESXi server will see that the clone has been moved or copied when we try to start the VM. The <a href="https://www.vmware.com/support/developer/PowerCLI/PowerCLI51R2/html/Set-VMQuestion.html" target="_blank">Set-VMQuestion</a> selects the &#8220;copied&#8221; answer, which is the default.</p>
<h2>Sample Usage</h2>
<p>Just</p>
<p>The function is quite easy to use.</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">Clone-MasterVM -MasterName W2K12Core_Base -CloneName Server1 -DatastoreName datastore2 -Register -PowerOn</pre><p></p>
<p>Note that the cloned VM will <strong>not be customised</strong> !</p>
<p>It will have the same configuration as the master VM from which it was cloned. The <strong>guest OS customisation</strong>, as can be done through the OSCustomizationSpec when there is a vCenter, is the subject for another post in this series.</p>
<p>What I normally do is to prepare my master with everything that I want to have on the cloned VMs. And then I run <strong>sysprep</strong> with the <strong>Shutdown</strong> option.</p>
<p style="padding-left: 60px;"><a href="https://www.lucd.info/2013/06/30/hl-tools-part-1-clone-a-vm-without-vcenter/sysprep-2/" rel="attachment wp-att-4495"><img loading="lazy" decoding="async" class="alignnone  wp-image-4495" alt="sysprep" src="https://lucd.info/wp-content/uploads/2013/06/sysprep1.png" width="379" height="269" srcset="https://www.lucd.info/wp-content/uploads/2013/06/sysprep1.png 474w, https://www.lucd.info/wp-content/uploads/2013/06/sysprep1-300x212.png 300w" sizes="auto, (max-width: 379px) 100vw, 379px" /></a></p>
<p>When the cloned VM is started, it will start with the mini-setup.</p>
<p>Enjoy !</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.lucd.info/2013/06/30/hl-tools-part-1-clone-a-vm-without-vcenter/feed/</wfw:commentRss>
			<slash:comments>22</slash:comments>
		
		
			</item>
	</channel>
</rss>
