Book Image

Microsoft System Center Virtual Machine Manager 2012 Cookbook

By : EDVALDO ALESSANDRO CARDOSO, Edvaldo Alessandro Cardoso Sobrinho
Book Image

Microsoft System Center Virtual Machine Manager 2012 Cookbook

By: EDVALDO ALESSANDRO CARDOSO, Edvaldo Alessandro Cardoso Sobrinho

Overview of this book

Microsoft System Center 2012 is a comprehensive IT infrastructure, virtualization, and cloud management platform. With System Center 2012, you can more easily and efficiently manage your applications and services across multiple hypervisors as well as across public and private cloud infrastructures to deliver flexible and cost-effective IT services for your business.This cookbook covers architecture design and planning and is full of deployment tips, techniques, and solutions designed to show users how to improve VMM 2012 in a real world scenario. It will guide you to create, deploy, and manage your own Private Cloud with a mix of Hypervisors: Hyper-V, Vmware ESXi, and Citrix XenServer. It also includes the VMM 2012 SP1 features.This book is a cookbook that covers architecture design, planning and is full of deployment tips, techniques and solutions designed to show users how to improve VMM 2012 in a real world scenario. It will guide you to create, deploy and manage your own Private Cloud with a mix of Hypervisors : Hyper-V, Vmware ESXi and Citrix XenServer.
Table of Contents (16 chapters)
Microsoft System Center Virtual Machine Manager 2012 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

VMM sample scripts


The sample scripts in this recipe illustrate how to use Windows PowerShell for centralized management.

You can use VMM PowerShell cmdlets to automate VMM tasks by executing them from a machine with the VMM console installed.

The following section contains some samples to add storage and convert the VHD disk format to the VHDX disk format.

How to do it...

You can use PowerShell scripts to automate various tasks. The following sample script counts the number of VMs per OS.

Counting the number of virtual machines per operating system

Import-Module virtualmachinemanager
$vHosts = Get-SCVMHost
foreach ($vHost in $vHosts){ 
   Get-SCVirtualMachine -VmHost $vHost | Group-Object OperatingSystem | Sort Count –Descending | Select Name, Count
}

How it works...

The script starts by importing the virtualmachinemanager module. It then creates a variable that will store all hosts.

For each host, it gets all the virtual machines and groups them by the operational system (OS) property. Finally...