Hi,
is it possible to create a new VM without any disk?
Additional:
How would i remove a disk from a VM? And delete the Disk from Datastore? through PowerCLI
Thanks!
Yes it is possible to create a VM without a hard disk - it will then be able to boot form cd, floppy or PXE -
If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
I assume your question was how to do this with PowerCLI.
On the New-VM you can't specify afaik that there should be no hard disk.
You can do the following in your script
$vmImpl = New-VM -Name MVV30111 -VMHost (Get-VMHost mmmstv004.muac.corp.eurocontrol.int) ` -Datastore (Get-Datastore -Name devvmfs1) $vmImpl | Get-HardDisk | Remove-HardDisk -Confirm:$false
Unfortunately this will not remove the .VMDK file, just the definition of the virtual disk from the .VMX.
Have a look at PowerShell Remove Harddisk Function, which is a similar question.
As I said there you could use the remove-HD function in Adding an existing hard disk
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi,
As per my understanding, there is no way to create VM without hard disk with New-VM cmdlet directly. As LucD has suggested first create new VM and then remove hard disk or otherwise you can create VM in different way. This is code snippet which might be helpful
$vmCreateSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmCreateSpec.Name = |Get-View
$fld.CreateVM_Task($vmCreateSpec,$poolmor,$vmhmor)
Hope this helps.
Thanks, i will have a look on the two suggested solutions. Might be a feature request for the new-vm commandlet to have a -disk:$false switch. As there is a checkbox in the gui i think thats not much effort