In the previous article we created template that is assembled from the VHDX and profiles and now we will use it to create new virtual machine.

Create VM from the existing template

  • Create Virtual Machine
  • Choose VM Template and you will not have to apply any profiles because the template already contains the configuration that may be correct for you.
  • Or choose VHDX of the template and will you have to apply the profiles.
  • We will use an existing VM Template that we created in the previous article.
  • Name the new VM and leave the generation without change.
      • conttestvm0
      • Generation 2
  • Choose existing Hardware Profile or use existing configuration that is defined in the template.
  • In the Configure Hardware step you are able to choose to assign a static IP address from the existing IP Pool.
    • It is not possible to assign IP from the IP Pool when you create VM for example from the virtual disk. You have to deploy VM from the VM Template.
    • Example of the VM from the VM Template with assigned static IP address from the IP Pool.
    • It is not possible to assign a IP address later for already existing VMs even when these VMs was deployed from the VM Template.
    • Example of the VM from the VM Template. Static IP address was not chosen.
  • Select host or in our case the cluster node.

Create virtual machine from the VM Template using PowerShell

You can very easily create VM from the template using PowerShell.

$template = Get-SCVMTemplate -Name 'ws2012r2u1'
$virtualMachineConfiguration = New-SCVMConfiguration -VMTemplate $template
$cloud = Get-SCCloud -Name 'Contoso'
New-SCVirtualMachine -Name 'conttestvm6' -VMConfiguration $virtualMachineConfiguration -Cloud $cloud -ReturnImmediately
« Previous Next »

Part of the series

  1. Building Microsoft System Center Cloud - Outline