Hi everyone, Konstantin Zoryn here, and today I’d like to talk about importing and exporting Templates in SCVMM 2012. System Center Virtual Machine Manager 2012 (VMM 2012) allows creating service and virtual machine templates and there are many configuration details captured inside the templates such as hardware description, operating system settings, application settings, network configuration, etc. The ability to save a template as a file on the disk can be very handy when you want to back up a good version of the template or share a template between different environments or multiple VMM installations. This blog post will describe new Import/Export Template actions available for templates in VMM 2012.
Let’s start with template exports. This article will use service template as an example. However, same functionality is available for virtual machine templates as well.
In the Library workspace, an Export action is available on the ribbon, on the Service Template tab. The same action is available on the context menu (displayed by right-clicking the selected object) after you select templates that you want to export. One or many templates can be exported at the same time.
To export templates, just select the templates and use the Export action on the context (right-click) menu or on the ribbon.
The Export action opens the Export Template Resources dialog box.
The following options are available as part of the export operation:
· Override existing export files. If the file with the same name is present at destination location it will be overridden.
· Export sensitive template settings. If this option is cleared, the exported service template will not contain any private information. That includes passwords, product keys, and application and global settings that are marked as secure.
· Encrypt template settings. This option allows to specify an encryption password for sensitive template settings if choose to export them. Note, that only content of the sensitive setting is encrypted.
· Location – Specify a destination folder path. The destination path doesn’t need to be on the library server. It can be any network share or local disk location accessible by the Admin Console user. The default file name is a combination of name and release properties of the template, e.g. “StockTrader Service Template.v1.xml”.
Please note that VMM 2012 Beta only exports and imports single XML file containing metadata about the template. All physical resources must be exported and imported out of band.
“View Script” button opens Notepad window with PowerShell script for the operation:
Use the Import Template action in the Library workspace to import a service or virtual machine template in VMM 2012. Open Home tab on the ribbon, then select the Import Template action.
This starts the Import Package Wizard. On the Select Package page, You will be asked to select a template file on the disk. There is an option to choose importing sensitive template settings (password, product keys, etc.) as part of the import operation or ignore them.
The next page of Import Package Wizard – Configure References – displays all external resources used in the package. The screen below shows references for a sample service template.
The references include two categories of external resources:
- Physical files (VHDs, ISOs, application packages, etc.)
- Logical resources (logical networks, storage classifications, run as profiles, etc.)
The Usage column contains the name of the machine tier or the application host template where the resource is used.
When you import a template, VMM tries to find the best match for each resource in the destination VMM environment, and displays a warning icon if no match is found. The default mapping is done by matching the Name and Release properties of the resource.
It is also possible to specify different resource mapping using the pencil icon in the rightmost column of the table. The red X icon clears selected resource mapping.
The ability to remap resource references can be very useful if the same resources have different names in the source and destination VMM installations. For example, a base operating system VHD could have the name Win2k8R2Ent.vhd in the original VMM deployment, but have the name “Windows 2008 R2.vhd” in VMM where service template is being imported.
If VMM 2012 does not find an appropriate mapping, and the user does not provide one, the reference to the resource is removed, template is put into “Needs Attention” state and a warning appears on the Import Template job.
The summary of the Import operation is displayed in the end of the wizard. “View Script” button opens Notepad window with PowerShell script for this operation.
After Import job is complete service template appears on the Service Template tab of the Library workspace. Service Template Designer can be used to do further configuration of the template.
Konstantin Zoryn | Software Development Engineer II
The App-V Team blog: http://blogs.technet.com/appv/
The WSUS Support Team blog: http://blogs.technet.com/sus/
The SCMDM Support Team blog: http://blogs.technet.com/mdm/
The ConfigMgr Support Team blog: http://blogs.technet.com/configurationmgr/
The SCOM 2007 Support Team blog: http://blogs.technet.com/operationsmgr/
The SCVMM Team blog: http://blogs.technet.com/scvmm/
The MED-V Team blog: http://blogs.technet.com/medv/
The DPM Team blog: http://blogs.technet.com/dpm/
The OOB Support Team blog: http://blogs.technet.com/oob/
The Opalis Team blog: http://blogs.technet.com/opalis
The Service Manager Team blog: http: http://blogs.technet.com/b/servicemanager
The AVIcode Team blog: http: http://blogs.technet.com/b/avicode
The System Center Essentials Team blog: http: http://blogs.technet.com/b/systemcenteressentials
The Server App-V Team blog: http: http://blogs.technet.com/b/serverappv