Boot disk index must be specified | Nutanix Community
Skip to main content
Solved

Boot disk index must be specified


Forum|alt.badge.img+1

Hello All,

 

         I am working on a powershell script to create VM’s and I am having an issue with the following piece.

 

$boot=New-NutanixObject BootConfig
$boot.uefi_boot=$true
$boot.secure_boot=$true
$boot.boot_device_type='DISK'
$boot.disk_address=$vmDisk.vm_disk_clone.disk_address
 
The error I am seeing is “Boot disk index must be specified”
 
I used the following to make the $vmDisk variable you are seeing at the bottom of the trouble code.
 
$diskImage = (Get-Image | Where-object {$_.name -eq $vmdisks})
$diskImage = Get-Image -IncludeVmDiskId -ImageId $diskImage.UUID                
$cloneDiskAddress=New-NutanixObject VMDiskAddress
$cloneDiskAddress.vmdisk_uuid=$diskImage.vm_disk_id
$vmDiskClone=New-NutanixObject VMDiskSpecClone
$vmDiskClone.disk_address=$cloneDiskAddress
$vmDisk=New-NutanixObject VMDisk
$vmDisk.is_cdrom=$false
$vmDisk.vm_disk_clone=$vmDiskClone
 
 
I know it is something simple I just don’t know what it is.
 
I appreciate any help.
 
Thanks,
Scott

Best answer by skeeter

Hello All,

 

      I figured that part out. Below is the code required.

 

$boot=New-NutanixObject BootConfig
$boot.uefi_boot=$true
$boot.secure_boot=$true
$boot.boot_device_type='DISK'
$boot.disk_address=$vmDisk[0].vm_disk_clone.disk_address
$boot.disk_address.device_index = 0
$boot.disk_address.device_bus = 'SCSI'

 

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

2 replies

Forum|alt.badge.img+1
  • Author
  • Trailblazer
  • 20 replies
  • Answer
  • June 3, 2022

Hello All,

 

      I figured that part out. Below is the code required.

 

$boot=New-NutanixObject BootConfig
$boot.uefi_boot=$true
$boot.secure_boot=$true
$boot.boot_device_type='DISK'
$boot.disk_address=$vmDisk[0].vm_disk_clone.disk_address
$boot.disk_address.device_index = 0
$boot.disk_address.device_bus = 'SCSI'

 


aluciani
Forum|alt.badge.img+34
  • Chevalier
  • 348 replies
  • June 14, 2022

Thanks for sharing @skeeter