Deallocating and generalizing

Before creating an image from the source virtual machine, the virtual machine must first be deallocated and marked as generalized in Azure:

  1. Confirm the myVM2 virtual machine has been shut down by running the Get-AzureRmVm command:
      Get-AzureRmVm -Name MyVM2 -ResourceGroupName VMLab -status
  1. Stop and deallocate the virtual machine by running the following command:
     Stop-AzureRmVm -ResourceGroupName VMLab -Name myVM2 -Force
  1. Run the Get-AzureRmVm command to be sure the virtual machine is stopped and deallocated:
      Get-AzureRmVm -Name MyVM2 -ResourceGroupName VMLab -status
  1. Once the virtual machine has stopped and shows deallocated when you run Get-AzureRmVm, set its status to generalized using the Set-AzureRmVm command:
      Set-AzureRmVM -ResourceGroupName VMLab -Name myVM2 -Generalized
  1. Running the preceding command deallocates the source virtual machine and marks it as generalized, preparing it for the imaging process. Confirm that the machine is generalized by running the Get-AzureRmVm command: 
      Get-AzureRmVm -Name MyVM2 -ResourceGroupName VMLab -status

You should see VM generalized as one of the statuses listed.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.26.176