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?
LVL 2
itniflAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

andersoncarvalhoCommented:
Have you already tried to do this through the Hyper-V console? First you need to turn off it. See attached.
hyper-v.PNG
0
itniflAuthor 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.
0
andersoncarvalhoCommented:
Oh I'm sorry, my bad. Take a look at the following link I think it can help you:

http://kristiannese.blogspot.com.br/2014/05/setting-all-gen2-vm-templates-to-use.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

andersoncarvalhoCommented:
0
itniflAuthor 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

0
andersoncarvalhoCommented:
Great!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Virtual Server

From novice to tech pro — start learning today.