<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>
	Comments on: Create multiple VMs from existing vSphere VM using PowerCLI	</title>
	<atom:link href="https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/feed/" rel="self" type="application/rss+xml" />
	<link>https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/</link>
	<description></description>
	<lastBuildDate>Wed, 15 Apr 2020 18:51:40 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: Flipp		</title>
		<link>https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-188057</link>

		<dc:creator><![CDATA[Flipp]]></dc:creator>
		<pubDate>Wed, 15 Apr 2020 18:51:40 +0000</pubDate>
		<guid isPermaLink="false">http://magander.se/?p=3064#comment-188057</guid>

					<description><![CDATA[Tested in 6.7.  Not working.]]></description>
			<content:encoded><![CDATA[<p>Tested in 6.7.  Not working.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: magander3		</title>
		<link>https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-187881</link>

		<dc:creator><![CDATA[magander3]]></dc:creator>
		<pubDate>Wed, 08 Apr 2020 19:01:30 +0000</pubDate>
		<guid isPermaLink="false">http://magander.se/?p=3064#comment-187881</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-187877&quot;&gt;G&lt;/a&gt;.

Hi,
ok glad it helped. If the ESXi hosts are in a vSphere cluster it should take care of it for you.

thanks]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-187877">G</a>.</p>
<p>Hi,<br />
ok glad it helped. If the ESXi hosts are in a vSphere cluster it should take care of it for you.</p>
<p>thanks</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: G		</title>
		<link>https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-187877</link>

		<dc:creator><![CDATA[G]]></dc:creator>
		<pubDate>Wed, 08 Apr 2020 17:11:47 +0000</pubDate>
		<guid isPermaLink="false">http://magander.se/?p=3064#comment-187877</guid>

					<description><![CDATA[Hi,

This script helped a lot with my project, but I have a question.

$ESXi=Get-Cluster $Cluster &#124; Get-VMHost -state connected &#124; Get-Random

I know this line distributes VMs over the ESXi hosts within the vSphere cluster, but what happens if one the hosts is full? Will it throw an error if it randomly chooses a host with no space for a new VM?

Thanks!]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>This script helped a lot with my project, but I have a question.</p>
<p>$ESXi=Get-Cluster $Cluster | Get-VMHost -state connected | Get-Random</p>
<p>I know this line distributes VMs over the ESXi hosts within the vSphere cluster, but what happens if one the hosts is full? Will it throw an error if it randomly chooses a host with no space for a new VM?</p>
<p>Thanks!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: magander3		</title>
		<link>https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-163449</link>

		<dc:creator><![CDATA[magander3]]></dc:creator>
		<pubDate>Wed, 30 Jan 2019 07:51:21 +0000</pubDate>
		<guid isPermaLink="false">http://magander.se/?p=3064#comment-163449</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-163432&quot;&gt;Rob&lt;/a&gt;.

Hi,
the idea with this script is to create multiple VMs when you run the script once. If you just want one VM to be created you can just run the last piece in the script:
New-VM -Name $VM_Name -VM $clone -VMHost $ESXi -Datastore $ds -Location $Folder -OSCustomizationSpec $customspecification -RunAsync

You will have to specify the variables or just change them for static values.

thanks]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-163432">Rob</a>.</p>
<p>Hi,<br />
the idea with this script is to create multiple VMs when you run the script once. If you just want one VM to be created you can just run the last piece in the script:<br />
New-VM -Name $VM_Name -VM $clone -VMHost $ESXi -Datastore $ds -Location $Folder -OSCustomizationSpec $customspecification -RunAsync</p>
<p>You will have to specify the variables or just change them for static values.</p>
<p>thanks</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rob		</title>
		<link>https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-163432</link>

		<dc:creator><![CDATA[Rob]]></dc:creator>
		<pubDate>Wed, 30 Jan 2019 00:43:40 +0000</pubDate>
		<guid isPermaLink="false">http://magander.se/?p=3064#comment-163432</guid>

					<description><![CDATA[I know this has been a while but I am just now discovering this script. Could you tell me what I have to do to make this script create &quot;server-1&quot; then when I run the script again it creates &quot;server-2&quot; and so forth and so on? Thanks!]]></description>
			<content:encoded><![CDATA[<p>I know this has been a while but I am just now discovering this script. Could you tell me what I have to do to make this script create &#8220;server-1&#8221; then when I run the script again it creates &#8220;server-2&#8221; and so forth and so on? Thanks!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: David Memenza		</title>
		<link>https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-157245</link>

		<dc:creator><![CDATA[David Memenza]]></dc:creator>
		<pubDate>Fri, 09 Nov 2018 13:59:31 +0000</pubDate>
		<guid isPermaLink="false">http://magander.se/?p=3064#comment-157245</guid>

					<description><![CDATA[excellent, thanks very much!

- DM]]></description>
			<content:encoded><![CDATA[<p>excellent, thanks very much!</p>
<p>&#8211; DM</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: magander3		</title>
		<link>https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-157221</link>

		<dc:creator><![CDATA[magander3]]></dc:creator>
		<pubDate>Fri, 09 Nov 2018 08:43:38 +0000</pubDate>
		<guid isPermaLink="false">http://magander.se/?p=3064#comment-157221</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-157204&quot;&gt;David Memenza&lt;/a&gt;.

Hi,
if you need to create only 15 VMs, you should change $vm_count to 15 meaning
$vm_count = &quot;15&quot;
Yes you can use D1 and the + is the correct way. Will update the original script.

Thanks]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-157204">David Memenza</a>.</p>
<p>Hi,<br />
if you need to create only 15 VMs, you should change $vm_count to 15 meaning<br />
$vm_count = &#8220;15&#8221;<br />
Yes you can use D1 and the + is the correct way. Will update the original script.</p>
<p>Thanks</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: David Memenza		</title>
		<link>https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-157204</link>

		<dc:creator><![CDATA[David Memenza]]></dc:creator>
		<pubDate>Fri, 09 Nov 2018 03:49:51 +0000</pubDate>
		<guid isPermaLink="false">http://magander.se/?p=3064#comment-157204</guid>

					<description><![CDATA[Hi magander3,

Quick question about your script please...

$y=&quot;{0:D2}&quot; -f $_ 
       - OR -
$y=”{0:D2}” -f + $_

The 1st was in your original script.  The 2nd was in your updated post with script changes.  You mentioned the line had no changes, but it looks like there is a slight change with the &quot;+&quot; after the -f.

Also, I&#039;m only creating/cloning 15 VM&#039;s, so I think I can edit $y=&quot;{0:D2)&quot; to read $y=&quot;{0:D1)&quot;...is this correct?

Thanks in advance for your help!

- DM]]></description>
			<content:encoded><![CDATA[<p>Hi magander3,</p>
<p>Quick question about your script please&#8230;</p>
<p>$y=&#8221;{0:D2}&#8221; -f $_<br />
       &#8211; OR &#8211;<br />
$y=”{0:D2}” -f + $_</p>
<p>The 1st was in your original script.  The 2nd was in your updated post with script changes.  You mentioned the line had no changes, but it looks like there is a slight change with the &#8220;+&#8221; after the -f.</p>
<p>Also, I&#8217;m only creating/cloning 15 VM&#8217;s, so I think I can edit $y=&#8221;{0:D2)&#8221; to read $y=&#8221;{0:D1)&#8221;&#8230;is this correct?</p>
<p>Thanks in advance for your help!</p>
<p>&#8211; DM</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: magander3		</title>
		<link>https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-155770</link>

		<dc:creator><![CDATA[magander3]]></dc:creator>
		<pubDate>Wed, 17 Oct 2018 05:46:50 +0000</pubDate>
		<guid isPermaLink="false">http://magander.se/?p=3064#comment-155770</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-155769&quot;&gt;Sachin&lt;/a&gt;.

Hi,
not sure I can do that much since it complains about the customer spec. Do you really have a spec called INPUN-DSVCSLS112-customization?

thanks]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-155769">Sachin</a>.</p>
<p>Hi,<br />
not sure I can do that much since it complains about the customer spec. Do you really have a spec called INPUN-DSVCSLS112-customization?</p>
<p>thanks</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sachin		</title>
		<link>https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-155769</link>

		<dc:creator><![CDATA[Sachin]]></dc:creator>
		<pubDate>Wed, 17 Oct 2018 05:43:38 +0000</pubDate>
		<guid isPermaLink="false">http://magander.se/?p=3064#comment-155769</guid>

					<description><![CDATA[New-VM : 17-10-2018 11:12:26    New-VM          Could not find OSCustomizationSpec with name &#039;INPUN-DSVCSLS112-customization&#039;.
At C:\Users\sachin.thopate\Desktop\CSLS.ps1:44 char:1
+ New-VM -Name $VM_Name -VM $clone -VMHost $ESXi -Datastore $ds -Locati ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (INPUN-DSVCSLS112-customization:String) [New-VM], VimException
    + FullyQualifiedErrorId : Core_ObnSelector_SelectObjectByNameCore_ObjectNotFound,VMware.VimAutomation.ViCore.Cmdle
   ts.Commands.NewVM

New-VM : 17-10-2018 11:12:26    New-VM          OSCustomizationSpec parameter: Could not find any of the objects specified by
name.
At C:\Users\sachin.thopate\Desktop\CSLS.ps1:44 char:1
+ New-VM -Name $VM_Name -VM $clone -VMHost $ESXi -Datastore $ds -Locati ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (VMware.VimAutom...stomizationSpec:RuntimePropertyInfo) [New-VM], ObnRec
   ordProcessingFailedException
    + FullyQualifiedErrorId : Core_ObnSelector_SetNewParameterValue_ObjectNotFoundCritical,VMware.VimAutomation.ViCore
   .Cmdlets.Commands.NewVM


I am getting above error please help on this.]]></description>
			<content:encoded><![CDATA[<p>New-VM : 17-10-2018 11:12:26    New-VM          Could not find OSCustomizationSpec with name &#8216;INPUN-DSVCSLS112-customization&#8217;.<br />
At C:\Users\sachin.thopate\Desktop\CSLS.ps1:44 char:1<br />
+ New-VM -Name $VM_Name -VM $clone -VMHost $ESXi -Datastore $ds -Locati &#8230;<br />
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
    + CategoryInfo          : ObjectNotFound: (INPUN-DSVCSLS112-customization:String) [New-VM], VimException<br />
    + FullyQualifiedErrorId : Core_ObnSelector_SelectObjectByNameCore_ObjectNotFound,VMware.VimAutomation.ViCore.Cmdle<br />
   ts.Commands.NewVM</p>
<p>New-VM : 17-10-2018 11:12:26    New-VM          OSCustomizationSpec parameter: Could not find any of the objects specified by<br />
name.<br />
At C:\Users\sachin.thopate\Desktop\CSLS.ps1:44 char:1<br />
+ New-VM -Name $VM_Name -VM $clone -VMHost $ESXi -Datastore $ds -Locati &#8230;<br />
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
    + CategoryInfo          : ObjectNotFound: (VMware.VimAutom&#8230;stomizationSpec:RuntimePropertyInfo) [New-VM], ObnRec<br />
   ordProcessingFailedException<br />
    + FullyQualifiedErrorId : Core_ObnSelector_SetNewParameterValue_ObjectNotFoundCritical,VMware.VimAutomation.ViCore<br />
   .Cmdlets.Commands.NewVM</p>
<p>I am getting above error please help on this.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: magander3		</title>
		<link>https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-155180</link>

		<dc:creator><![CDATA[magander3]]></dc:creator>
		<pubDate>Tue, 09 Oct 2018 12:08:59 +0000</pubDate>
		<guid isPermaLink="false">http://magander.se/?p=3064#comment-155180</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-155176&quot;&gt;Ryan&lt;/a&gt;.

Hi,
the below lie will do just that meaning distribute VMs over the ESXi hosts within the vSphere cluster.
$ESXi=Get-Cluster $Cluster &#124; Get-VMHost -state connected &#124; Get-Random

Doesn&#039;t it work?

thanks]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-155176">Ryan</a>.</p>
<p>Hi,<br />
the below lie will do just that meaning distribute VMs over the ESXi hosts within the vSphere cluster.<br />
$ESXi=Get-Cluster $Cluster | Get-VMHost -state connected | Get-Random</p>
<p>Doesn&#8217;t it work?</p>
<p>thanks</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ryan		</title>
		<link>https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-155176</link>

		<dc:creator><![CDATA[Ryan]]></dc:creator>
		<pubDate>Tue, 09 Oct 2018 11:25:08 +0000</pubDate>
		<guid isPermaLink="false">http://magander.se/?p=3064#comment-155176</guid>

					<description><![CDATA[Hi - thanks for this.
One question - i&#039;m trying to create a script that needs to distribute 30 VMs to multiple ESX Hosts rather than just one (reading from a .csv)

I tried:
$Host = Get-VMHost - Name $vm.Host 

but am receiving :

Cannot overwrite variable Host because it is read-only or constant.
At C:\Scripts\Connect.ps1:12 char:1
+ $Host = Get-VMHost -Name $vm.Host]]></description>
			<content:encoded><![CDATA[<p>Hi &#8211; thanks for this.<br />
One question &#8211; i&#8217;m trying to create a script that needs to distribute 30 VMs to multiple ESX Hosts rather than just one (reading from a .csv)</p>
<p>I tried:<br />
$Host = Get-VMHost &#8211; Name $vm.Host </p>
<p>but am receiving :</p>
<p>Cannot overwrite variable Host because it is read-only or constant.<br />
At C:\Scripts\Connect.ps1:12 char:1<br />
+ $Host = Get-VMHost -Name $vm.Host</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: sbobet mobile indonesia		</title>
		<link>https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-148552</link>

		<dc:creator><![CDATA[sbobet mobile indonesia]]></dc:creator>
		<pubDate>Sat, 07 Jul 2018 10:04:51 +0000</pubDate>
		<guid isPermaLink="false">http://magander.se/?p=3064#comment-148552</guid>

					<description><![CDATA[This is really fascinating, You&#039;re a very professional blogger.

I have joined your rss feed and look ahead to in the hunt for more of 
your great post. Additionally, I&#039;ve shared your website in my social networks]]></description>
			<content:encoded><![CDATA[<p>This is really fascinating, You&#8217;re a very professional blogger.</p>
<p>I have joined your rss feed and look ahead to in the hunt for more of<br />
your great post. Additionally, I&#8217;ve shared your website in my social networks</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: magander3		</title>
		<link>https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-145704</link>

		<dc:creator><![CDATA[magander3]]></dc:creator>
		<pubDate>Fri, 01 Jun 2018 05:09:42 +0000</pubDate>
		<guid isPermaLink="false">http://magander.se/?p=3064#comment-145704</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-145689&quot;&gt;detik sport&lt;/a&gt;.

Hi, using Wordpress and it works great.

thanks]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-145689">detik sport</a>.</p>
<p>Hi, using WordPress and it works great.</p>
<p>thanks</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: detik sport		</title>
		<link>https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-145689</link>

		<dc:creator><![CDATA[detik sport]]></dc:creator>
		<pubDate>Thu, 31 May 2018 15:32:17 +0000</pubDate>
		<guid isPermaLink="false">http://magander.se/?p=3064#comment-145689</guid>

					<description><![CDATA[Hey there this is somewhat of off topic but I was wondering if blogs use WYSIWYG editors 
or if you have to manually code with HTML. I&#039;m starting a blog soon but have no coding know-how so I wanted to get advice from someone 
with experience. Any help would be greatly appreciated!]]></description>
			<content:encoded><![CDATA[<p>Hey there this is somewhat of off topic but I was wondering if blogs use WYSIWYG editors<br />
or if you have to manually code with HTML. I&#8217;m starting a blog soon but have no coding know-how so I wanted to get advice from someone<br />
with experience. Any help would be greatly appreciated!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: magander3		</title>
		<link>https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-140426</link>

		<dc:creator><![CDATA[magander3]]></dc:creator>
		<pubDate>Wed, 21 Feb 2018 15:36:00 +0000</pubDate>
		<guid isPermaLink="false">http://magander.se/?p=3064#comment-140426</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-140419&quot;&gt;Martin&lt;/a&gt;.

hi,
actually had time to test this now and use the following:
# No changes required to the below line
$y=&quot;{0:D2}&quot; -f + $_ 
# New line below, change 50 to whatever your start number is in the VM naming convention.
$count = 50 + $y
# Updated line below, change $y at the end of the below line to $count
$VM_name = $VM_prefix + $count]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://magander.se/create-multiple-vms-from-existing-vsphere-vm-using-powercli/#comment-140419">Martin</a>.</p>
<p>hi,<br />
actually had time to test this now and use the following:<br />
# No changes required to the below line<br />
$y=&#8221;{0:D2}&#8221; -f + $_<br />
# New line below, change 50 to whatever your start number is in the VM naming convention.<br />
$count = 50 + $y<br />
# Updated line below, change $y at the end of the below line to $count<br />
$VM_name = $VM_prefix + $count</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>

<!--
Object Caching 21/71 objects using Disk
Page Caching using Disk: Enhanced 

Served from: magander.se @ 2026-06-25 17:09:40 by W3 Total Cache
-->