Link to home
Start Free TrialLog in
Avatar of itnifl
itniflFlag for Norway

asked on

Set the first boot device of a generation two Hyper-v virtual machine

I want to set the first boot device of a generation two Hyper-v virtual machine. As I have understood, the way to do this is to use the Set-SCVirtualMachine cmdlet with the FirstBootDevice parameter which takes some string:

Set-SCVirtualMachine -VM "theNameHere" -FirstBootDevice "someStringHere"

Open in new window


But I have found no examples on what that string is so that I actually am able to change the first boot device,
Here are various attempts:

PS C:\Windows\system32> Set-SCVirtualMachine -VM "nameHere" -FirstBootDevice "CD"
Set-SCVirtualMachine : The input string "CD" for the FirstBootDevice parameter cannot be parsed and may be invalid. (Er
ror ID: 23351, Detailed Error: )

Make sure the string uses one of the following formats: "SCSI,BusId(integer),LunId(integer)" or "NIC,SlotId(integer)"
At line:1 char:1
+ Set-SCVirtualMachine -VM "nameHere" -FirstBootDevice "CD"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ReadError: (:) [Set-SCVirtualMachine], CarmineException
    + FullyQualifiedErrorId : 23351,Microsoft.SystemCenter.VirtualMachineManager.Cmdlets.SetVMCmdlet


PS C:\Windows\system32> Set-SCVirtualMachine -VM "nameHere" -FirstBootDevice "SCSI,BusId(1)"
Set-SCVirtualMachine : The input string "SCSI,BusId(1)" for the FirstBootDevice parameter cannot be parsed and
 may be invalid. (Error ID: 23351, Detailed Error: )

Make sure the string uses one of the following formats: "SCSI,BusId(integer),LunId(integer)" or "NIC,SlotId(integer)"
At line:1 char:1
+ Set-SCVirtualMachine -VM "nameHere" -FirstBootDevice "SCSI,BusId(1) ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ReadError: (:) [Set-SCVirtualMachine], CarmineException
    + FullyQualifiedErrorId : 23351,Microsoft.SystemCenter.VirtualMachineManager.Cmdlets.SetVMCmdlet

I also tried several other versions of this as a string, including lunId which I assumed was 1, but I have no idea. So, how to do this right?
Avatar of andersoncarvalho
andersoncarvalho

Have you already tried to do this through the Hyper-V console? First you need to turn off it. See attached.
hyper-v.PNG
Avatar of itnifl

ASKER

I am guessing that you are dealing with a Generation 1 Hyper-V Guest in your example? Because this menu is not visible via VMM and the Firmware tab in the Hardware Configuration of the VM. There is a link there that points to:
http://technet.microsoft.com/library/dn440675.aspx

Because of underlying differences between generation 1 and generation 2 virtual machines, the startup order (boot order) for different devices (such as a hard disk or CD) is not handled the same way in the two generations. To customize the startup order for a generation 2 virtual machine in System Center 2012 R2, you must use a Windows PowerShell command that specifies the first boot device, rather than an ordered list of boot devices.

I need to set the first boot device to be the CD-ROM.
ASKER CERTIFIED SOLUTION
Avatar of andersoncarvalho
andersoncarvalho

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of itnifl

ASKER

Yes, I found the solution in you second post andersoncarvalho. It was simple:
User generated image
This translates into:
Set-SCVirtualMachine -VM "VMName" -FirstBootDevice "SCSI,0,1"

Open in new window