Walkthrough: Provisioning a VM from a Hyper-V Generation 2 template
This topic walks you through the process of provisioning a virtual machine (VM) from a Hyper-V Generation 2 template. This topic includes the following sections:
Introduction
Manually creating and deploying VMs takes a great deal of time and effort. It is also a potentially error prone process, as there are so many steps that must be repeated during the installation of each VM, some of which vary by virtualization platform. However, using a Virtual Guest Package (VGP) and Virtual Guest Job (VGJ) provides a repeatable process for creating new VMs according to a specific configuration that you define or clone from a template.
TrueSight Server Automation supports the cloning of VMs as well as the cloning of templates into new VMs.
What is a Virtual Guest Package?
A VGP bundles configuration changes so they can be deployed to hosts/clusters using a Virtual Guest Job. The VGP consists of an instruction set and any files needed for implementing configuration changes. Configuration changes can consist of additions, deletions, and modifications to any of the server objects TrueSight Server Automation supports on all operating systems. You can create multiple VGPs, each designed and tailored for a specific use. For example, you can create one VGP that defines a VM for a SQL Server used in development, while another can be tailored for use by QA as a web server.
What is a Virtual Guest Job?
A VGJ deploys a VM to a target host server. A VGJ is based on a VGP that must be created previously.
What does this walkthrough show?
As a virtualization administrator, you need to be able to provide a template-based approach to deploying Hyper-V based VMs.
Your organization wants to use Generation 2 Hyper-V templates for provisioning both Microsoft Windows 2012 R2 and RedHat Enterprise Linux version 7 and 7.1 VMs.
Your organization also needs to customize the VM host name, and also support standard VM actions post deployment. For example, with Generation 2 Hyper-V you can perform online memory upgrades (hot swappable memory).
This walkthrough shows how to:
- Create and customize a Virtual Guest Package
- Create and run a Virtual Guest Job with basic parameters to provision a Microsoft Windows Hyper-V VM.
- Create and run a BLPackage that upgrades the memory of the VM.
What do I need to do before I get started?
- This example assumes that you have existing VM Templates from which you want to deploy new VMs. To set up the templates, see Creating-Generation-2-Virtual-Machine-Templates-on-SCVMM. You can use a Virtual Guest Template Enrollment Job to automatically discover operating system templates on those systems, and create VGPs for the discovered templates. See Automatically-creating-a-Virtual-Guest-Package.
- Prior to provisioning, you need to add the Microsoft System Center Virtual Machine Manager (SCVMM) to the TrueSight Server Automation environment, set up the properties for the connection instance, and distribute the SCVMM configuration object. See Adding-the-Microsoft-SCVMM-server-to-TrueSight-Server-Automation.
- For this walkthrough, you log on as BLAdmin, the default superuser for TrueSight Server Automation. Ensure that the BLAdmin user has the VirtualGuestJob.Create, VirtualGuestJob.Read, VirtualGuestPackage.Create, and VirtualGuestPackage.Read authorizations. Note that in live deployments, BMC recommends you grant access based on roles with a narrower set of permissions that is typically granted to BLAdmin.
How to provision a VM from a Hyper-V Generation 2 template
There are three basic steps to provision a VM from a Hyper-V Generation 2 template:
- Create the VGP
- Create and run a VGJ.
- Create and run a BLPackage that upgrades the memory of the VM.
Create the VGP
| Step | Example screen |
---|---|---|
1 | First, you need to create the VGP. | |
2 | Provide VM name and select the template Select the template from the host | |
3 | Complete creation of VGP | |
4 | Click Finish to save the VGP. | |
5 | Now that the VGP is created, edit the settings. The edit screen is displayed automatically when you save the VGP. Edit the VGP 6. | |
6 | In the storage tab provide the storage location On the Storage tab, click the plus sign to add a virtual disk. The Virtual Disk Settings dialog box is displayed. Click the Browse button next to the Storage field.
| |
7 | On the Select Storage dialog box: Select a server from the Select Server drop-down list. Select the Virtual Guest Storage host and storage Click OK. On the The Virtual Disk Settings dialog box, click OK to save the storage settings for the virtual disk. | |
8 | On the Network tab, click the plus sign to add a network. The Virtual Network Interface Settings dialog box is displayed. Click the Browse button next to the Network field. Select a server from the Select Network drop-down list. Select the network settings of your choice. Click OK to save the network settings. | |
9 | On the VM Basic Config tab, enter Local Settings details | |
10 | On the VM Computer Settings tab, enter User Information. Close the VGP and save your changes when prompted. Next, we need to create the VGJ that will use this VGP as the base for the new VM. |
Create and run the VGJ
| Step | Example screen |
---|---|---|
1 | Select the VGP and create VGJ | |
2 | Provide Name for the VGJ | |
|
| |
3 | Provide Target Host |
|
4 | Customize General Settings CPU, Memory if required | |
5 | Customize disk addition | |
6 | Customize Network | |
7 | Customize Local Settings | |
8 | Customize User Information | |
9 | Execute the Job |
|
Create and run a BLPackage that upgrades the memory of the VM.
| Step | Example screen |
---|---|---|
1 | Create BLPackage of VM:
The BLPackage wizard is displayed. | |
2 | On the Create BLPackage - Package Type panel, enter a name for the package and select Finish. | |
3 | Open the BLPackage and modify the parameters, as needed. You can modify the number of virtual CPUs, add memory, add a NIC, and add a disk. In this example, we want to increase the amount of memory for the VM.
| |
4 | Next, we save and deploy the package. Right-click the package and select Deploy. | |
5 | Verify that the memory modification is reflected for the VM.
|
|
Wrapping it up
In this walkthrough, you went through the process of provisioning a VM from a Hyper-V Generation 2 template, and then used a BLPackage to upgrade the memory on the VM after it was provisioned.
Where to go from here
Check out Walkthrough-Provisioning-Linux and Walkthrough-Provisioning-Microsoft-Windows-2012-on-a-bare-metal-machine to see how to provision other types of VMs.