10/01/2013

System Center Virtual Machine Manager

This is the fifth of a series of blog posts around Cloud Computing. It gives an overview about the current Cloud Computing trends and explains how to set up a private cloud environment with Microsoft's System Center products.

This post is about the System Center Virtual Machine Manager (SCVMM), its features, capabilities and especially integration points.

The SCVMM is the core of Microsofts System Center Suite. It provides a user interface for managing the private cloud environment. The SCVMM supports three virtualization platforms: Hyper-V, VMWare ESX and Citrixs Xen.

The SCVMM consists of two main applications, the administration console for managing clouds and the self-service portal giving the end-user access to his cloud infrastructure.

Important note:
The self-service portal is really rudimentary. If you are familiar with Windows Azure and you know its self service capabilities you will be very disappointed. That is also something very important to consider when building up your own private cloud. The basic setup is done quickly but offering the cloud service to your customers and integrating it into your IT landscape takes time and definitely needs custom implementation effort.

The good part is that the SCVMM User Interface is build on a flexible PowerShell layer which can be used to integrate the cloud management into your existing IT landscape.

Integration Layer - PowerShell
The PowerShell modules can be used to execute every possible command in SCVMM. It can used to integrate and automate processes like creating a virtual machine, networks or services.

The following remote PowerShell script lists all cloud environments in the SCVMM. The Invoke-Command specifies the remote computer name and the script to execute on this computer remotely. The first line of the script itself enables remote execution of signed scripts. By default, the PowerShell session allows only interactive commands. After that, the PowerShell module for the SCVMM is imported which enables a variety of new cmdlets. The last line executes the SCVMM command.

Invoke-Command -ComputerName winscvmm.tstune.de -ScriptBlock {
  Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
  Import-Module "C:\Program Files\Microsoft System Center 2012\Virtual Machine Manager\bin\psModules\virtualmachinemanager\virtualmachinemanager.psd1"
  Get-SCCloud
}

The Get-SCCloud command prints a list of all available cloud environments. The following output shows the details of the two available cloud environments for Test and Production:

PSComputerName         : winscvmm.tstune.de
RunspaceId             : 8266ea35-c166-4bba-b169-f4d40c00ca99
PSShowComputerName     : True
Description            : Cloud Test Environment
Name                   : TestCloud
LastModifiedDate       : 10/1/2013 1:40:00 AM
HostGroup              : {All Hosts}
CloudCapacity          : 7883d7f8-6608-4820-8f67-154e655da029
ID                     : 7883d7f8-6608-4820-8f67-154e655da029
IsViewOnly             : False
ObjectType             : Cloud
MarkedForDeletion      : False
IsFullyCached          : True

PSComputerName         : winscvmm.tstune.de
RunspaceId             : 8266ea35-c166-4bba-b169-f4d40c00ca99
PSShowComputerName     : True
Description            : Cloud Production Environment
Name                   : ProductionCloud
LastModifiedDate       : 10/1/2013 1:40:28 AM
HostGroup              : {All Hosts}
CloudCapacity          : 165228e8-674b-4f3b-b51f-bd848e45ea6e
ID                     : 165228e8-674b-4f3b-b51f-bd848e45ea6e
IsViewOnly             : False
ObjectType             : Cloud
MarkedForDeletion      : False
IsFullyCached          : True

PS C:\Users\Thomas>

The PowerShell commandlets provide a great and easy way to integrate the System Center Virtual Machine Manager with its cloud-capabilities into your existing IT landscape. The following script shows how easy it is to automate the creation of a virtual machine. This script could be easily used to integrate the SCVMM into existing ticketing systems which would reduce the overhead for setting up VMs manually:

$vmTemplateName = "Win2008R2_Template"
$cloudName = "TestCloud"
$vmName = "NewVM"
$memory = 1024
$cpus = 1

$cloud = Get-SCCloud -Name $cloudName
$vmTemplate = Get-SCVMTemplate -Name $vmTemplateName
$vmConfiguration = New-SCVMConfiguration -VMTemplate $vmTemplate -Name $vmName

New-SCVirtualMachine -Name $vmName -VMConfiguration $vmConfiguration -Cloud $cloud -Computername $vmName -CPUCount $cpus -MemoryMB $memory

This script takes a predefined template, called "Win2008R2_Template", and uses it to create a virtual machine configuration. This configuration is used together with a vm name, modified memory size and CPU count as a basis to set up a new VM.

No comments:

Post a Comment