We help IT Professionals succeed at work.

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

4,921 Views
Last Modified: 2014-11-12
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?
Comment
Watch Question

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

Author

Commented:
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.
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
itniflProgrammer

Author

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

Open in new window

Great!!

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.