• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3146
  • Last Modified:

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?
0
itnifl
Asked:
itnifl
  • 4
  • 2
1 Solution
 
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
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

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now