Skip to content

Instantly share code, notes, and snippets.

@bortels
Created November 5, 2013 00:31
Show Gist options
  • Save bortels/7311859 to your computer and use it in GitHub Desktop.
Save bortels/7311859 to your computer and use it in GitHub Desktop.
powercli example
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $vmhost
= Get-VMHost -Name vortex10a.wlvdev.diginsite.com
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $s.Creat
eVM.VM | foreach { New-VM -VMHost $vmhost -Name $_.Name -DiskGB $_.HDDCapacity }
Name PowerState Num CPUs MemoryGB
---- ---------- -------- --------
MyVM1 PoweredOff 1 0.250
New-VM : 11/4/2013 4:08:36 PM New-VM The operation for the entity
Folder-group-v3 failed with the following message: "Insufficient disk space on
datastore 'datastore10a'."
At line:1 char:28
+ $s.CreateVM.VM | foreach { New-VM -VMHost $vmhost -Name $_.Name -DiskGB
$_.HDDCa ...
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-VM], NoDiskSpace
+ FullyQualifiedErrorId : Client20_TaskServiceImpl_CheckServerSideTaskUpda
tes_OperationFailed,VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> Get-VM M
yVM1
Name PowerState Num CPUs MemoryGB
---- ---------- -------- --------
MyVM1 PoweredOff 1 0.250
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment