I have a script we are using to created linked clones. Works great. One of the things to fine tune our image we want the CD-ROM to be 😧 drive instead of E: The master 'image' we have doesn't have a floppy or cdrom enabled. Only after the image is copied do these things appear. Do I have to handle adjusting this stuff 'after' the VM is created? The CloneVM_Task doesn't appear to have additional properties to pass to handle things like this.
#Creates the VM
$sourceVM = Get-VM $ParentVMName | Get-View
$cloneFolder = $sourceVM.parent
$cloneSpec = new-object Vmware.Vim.VirtualMachineCloneSpec
$cloneSpec.Snapshot = $sourceVM.Snapshot.CurrentSnapshot
$cloneSpec.Location = new-object Vmware.Vim.VirtualMachineRelocateSpec
$cloneSpec.Location.DiskMoveType = [Vmware.Vim.VirtualMachineRelocateDiskMoveOptions]::createNewChildDiskBacking
$sourceVM.CloneVM_Task( $cloneFolder, $cloneName, $cloneSpec )