Showing posts with label Windows Server 8 beta. Show all posts
Showing posts with label Windows Server 8 beta. Show all posts

Tuesday, May 22, 2012

Rapid VM deployment with Powershell on Hyper-V 3

I have conducted a web seminar for 'Microsoft Partner Readiness Webminar' Module 2a which focusing on working with Hyper-V 3 with Powershell.

In my first demo 'Demo1', I have showed to the audience on how we could rapidly deploy VMs Without the use of:-
1. Hyper-V Manager
2. System Center Virtual Machine Manager

The Power of Powershell in managing VMs in Hyper-V

Most of us thought that with the Hyper-V Manager, we could do most of the administrative tasks easily. Well, time to rethink if you have hundreds (if not thousands) of VMs running on you Hyper-V infrastructure and you have to do the following :-
1. To find out the Startup Memory, Minimum Memory and Maximum Memory each VM
2. To find out vCPU count of each VM
3. To find out the vSwitch and VLAN ID each VM connected
With the few tasks as listed, immediately we know how complicated things going to be, and a good example is that we have to right-click each and every VM, properties just to find out these information.

Let think this through with Powershell, you could simply use these to solve the tasks above :-
1. Get-VMMemory -VMNAME <vmname> | ft vmname, startupmemory, minimummemory, maximummemory
2. Get-VMProcessors -VMNAME <vmname> | ft vmname, count
3. Get-VMnetwork

How Aboout Bulk Creating VMs ?

Yes ! Of course we can do that, in fact there are numerous ways in getting this done. In this blog I am going to share with you how we pre-defined the VMs configuration in an CSV spreadsheet and then use powershell to created alll these VMs.

I have change the script I shared last at How-To: Rapid Deploy VM Using Powershell to the following

$vmdefaultpath = "D:\VMs"
$ParentVHD = "D:\Hyper Base\WIN2K8R2SP1_Ent_Sysprep_180days_Updated20120404.vhd"
$path = "D:\vms\VMs.csv"
import-csv -path $path|ForEach-Object {
$erroractionpreference = 0    
$vmName = $_.Name
[int] $vmmemory = $_.Memory
$vmcpucount = $_.Cpucount
$vmSwitch = $_.Network
$vmpath = $vmdefaultpath
#Create the VM
New-VM -Name $vmname -Path $vmdefaultpath
#Set the VM Memory properties
Set-VM -Name $vmname -StaticMemory -MemoryStartupBytes $vmstartmemory
#Set the vCPU
Set-VMProcessor -VMName $vmname -Count $vmcpucount
#Connect the VM to vSwitch
Connect-VMNetworkAdapter -VMName $vmname -SwitchName $vmSwitch
#Create VHD for the VM
New-VHD -Path $vmpath\$vmname\$vmname.vhd -ParentPath $ParentVHD
#Add the VHD to the VM to IDE 0 Location 0
Add-VMHardDiskDrive -vmname $vmname -ControllerType IDE -ControllerNumber 0 -Path $vmpath\$vmname\$vmname.vhd
Write-Host -BackgroundColor Green -ForegroundColor Black "Virtual Machine $vmname has been successfully created"     

The script above:-
1. Reads all VM configuration listed in VMs.csv and create in Hyper-V 3 host
2. Stores all VMs configuration files, snapshots, and VHDs in D:\VMs\
3. Creates diferrencing disk for each VMs with the Parent VHD in D:\Hyper Base\
4. Creates VMs with static memory

You have to change this script properties to suit your environment if you plan to use this.

Below is the video i have captured, showing how the script works for my demo.

Sunday, April 15, 2012

System Center 2012 CTP for Windows Server "8" Beta

Have done some preliminary readings about CTP and its material.

What is CTP
Community Technology Preview (“CTP”) enables System Center customers to jointly evaluate System Center 2012 and Windows Server “8” Beta. Customers should use this CTP for their evaluations of Windows Server “8” beta, and to provide Microsoft with feedback on both products. The CTP includes updates to the Virtual Machine Manager and Data Protection Manager components of System Center 2012.

What are the technology available now in CTP
As of now, there are only 2 products available in CTP program, these are:-
  • Virtual Machine Manager 2012
  • Data Protection Manager 2012

What do I get out of SC2012 CTP

Virtual Machine Manager
The CTP enables the Virtual Machine Manager component's management server to run on Windows Server “8” as well as managing virtual machines (VMs) hosted on Windows Server “8”. The CTP also enables management of new Windows Server “8” features in Virtual Machine Manager:

  • Creation of Hyper-V Virtual Networks using Hyper-V Network Virtualization
  • Creation of virtual machines using the VHDx format
  • SMB 2.2 file servers as storage for virtual machines in a clustered and non-clustered environment
  • Live migration and live storage migration
Data Protection Manager The CTP enables the Data Protection Manager component's repository and agents to run on Windows Server ‘8” as well as providing protection in Windows Server “8” environments. The CTP also adds protection for new features in Windows Server “8”:

  • Hyper-V Virtual Machines on Cluster Shared Volumes 2.0 (CSV2.0)
  • Hyper-V Virtual Machines on remote SMB share
  • Files on De-Duplicated Volumes

What are the system requirements

Supported operating systems: Windows Server 2008, Windows Server 2008 R2, Windows Server 8 Beta

Data Protection Manager:
Windows 2008
Windows 2008 R2
Windows "8" Beta

Virtual Machine Manager:
Windows “8” Beta (Management Server, Console, Library Server, VM Hosts)
Windows “8” Beta or Windows Server 2008 R2 (Database Server)
Windows Server “8” is the only supported guest operating system

Other Software: SQL Server 2008 R2 with SP1, Standard, Enterprise or Datacenter Edition, 64-bit edition only

Pre-requisite Software: .NET 3.5

Hypervisor:  Data Protection Manager: Not applicable
Virtual Machine Manager: Hyper-V on Windows Server "8" only

Where can I get CTP

Saturday, April 7, 2012

Hyper-V Replica of Windows Server 8 Beta

I have blogged about Hyper-V replica a while ago when Windows Server 8 release as Developer Preview. And here comes the Windows Server 8 Beta released not long ago, Hyper-V Replica is everywhere on the net most exciting part of it, more and more detailed technical documentation make available by Microsoft to the public particular to this piece of Hyper-V components.
My first look is on the Windows Server 8 Hyper-V Component Architecture Poster and my first expression was…………<speechless>………..and WOW !!!! IMPRESSIVE!

Windows Server "8" Beta Hyper-V Component Architecture Poster

"Hyper-V Replica is an asynchronous virtual machine replication technology that is included in Windows Server "8" Beta. It is designed for business continuity and disaster recovery. It works with any server, network, or storage vendor. It does not require any shared storage. It enables you to replicate individual or multiple virtual machines. Hyper-V Replica is tightly integrated with Hyper-V and Failover Clustering. You can replicate virtual machines from one computer running Hyper-V at a primary site (the primary server) to another computer running Hyper-V at a Replica site (the Replica server). The Replica server accepts incoming replication traffic from one or more primary servers." - Windows Server "8" Beta Hyper-V Component Architecture Poster

Figure 1: Windows Server "8" Beta Hyper-V Component Architecture Poster

Technical Write Up
A document on Understand and Troubleshoot Hyper-V Replica in Windows Server "8" Beta is available for you if you are looking for the detailed bits of Hyper-V Replica in Windows Server 8. I personally find that this document is very useful for someone like me who involves in proposing Hyper-V design.

Hyper-V Replica with Powershell
For some of you would like to deploy Hyper-V with Server Core installation, you may be looking into managing Hyper-V Replica using Powershell. The below 2 blogs you may be interested in :

Technical Diagram of Hyper-V Replica

My previous testing and blog of Hyper-V Replica
You may refer to :-
How-To: Enable Hyper-V 3.0 Replica (Part 1)

More testing on the way when I secured hardware for testing :-)