locked
SCVMM - Creating VM with powershell RRS feed

  • Question

  • Hi,

    I try to create VM with SCVMM CmdLet.

    I Want to create a Powershell GUI that connect to SCVMM Server and get a template list.

    I want to know if i can use the New-vm CmdLet for create the VM with only the Template argument (i don't want to have to create a hardware profile and don't need guest os profile)

    Regards


    Monday, January 5, 2009 10:41 PM

Answers

  • You don't need any of the template arguments. 

    There are, however, a minimum set of arguments that the cmdlet does require.  simply querying new-vm allows you to see these and you can practice creating a vm to explore the minimum required parameters.

    The examples that the SCVMM UI provides when you view the powershell is far more detailed and indepth than is necessary.

    At the minimum you define RAM, and a vhd, and a location, and name (I think those are the minimums off the top of my head).

    Like I said, try it.  At the worst you create VMs that you have to delete or get an error from the cmdlet - which I will admit can occasionally be difficult to work through.

    Brian Ehlert (hopefully you have found this useful)
    • Proposed as answer by Mervyn Zhang Tuesday, January 6, 2009 9:13 AM
    • Marked as answer by Cédric Bravo Tuesday, January 6, 2009 10:00 AM
    Tuesday, January 6, 2009 2:42 AM

All replies

  • You don't need any of the template arguments. 

    There are, however, a minimum set of arguments that the cmdlet does require.  simply querying new-vm allows you to see these and you can practice creating a vm to explore the minimum required parameters.

    The examples that the SCVMM UI provides when you view the powershell is far more detailed and indepth than is necessary.

    At the minimum you define RAM, and a vhd, and a location, and name (I think those are the minimums off the top of my head).

    Like I said, try it.  At the worst you create VMs that you have to delete or get an error from the cmdlet - which I will admit can occasionally be difficult to work through.

    Brian Ehlert (hopefully you have found this useful)
    • Proposed as answer by Mervyn Zhang Tuesday, January 6, 2009 9:13 AM
    • Marked as answer by Cédric Bravo Tuesday, January 6, 2009 10:00 AM
    Tuesday, January 6, 2009 2:42 AM
  • Thanks for this answer... 

    You can effectively create a VM in using the template argument without the Hardware profile argument.

    The script given by SCVMM when you create a VM from a template in the GUI show a hardware profile creation from zero, but in fact you can use only the template since the template is allready associated with a hardware profile.

    Tuesday, January 6, 2009 4:37 PM