Search This Blog

Wednesday, April 24, 2013

Creating High Availability Virtual Machine Using Powershell–Part 3

 

Let continue from where we left in previous parts

Part 1 – talked about converting sysprep image and create new virtual hard disk

Part 2 – talked about creating VM configuration by using hard disk from Part 1 and configure VM settings.

In our next part, we will discuss about creating high availability virtual machine whereby the created VM has located in Cluster Shared Volume (CSV). Here is the example to guide you in this article

Example:-

VM Name Priority Preferred Owner
Donut High Server1
Eclair Low Server1
Froyo Medium Server2
Gingerbread Low Server2
HoneyComb Low Server2
IceCream Low Server1

Let look into how we should configure using Powershell

1. Add VM as High Availability Virtual Machine

Cmdlet:- Add-ClusterVirtualMachineRole

Add-ClusterVirtualMachineRole -VirtualMachine Donut
Add-ClusterVirtualMachineRole -VirtualMachine Exclair
Add-ClusterVirtualMachineRole -VirtualMachine Froyo
Add-ClusterVirtualMachineRole -VirtualMachine Gingerbread
Add-ClusterVirtualMachineRole -VirtualMachine HoneyComb
Add-ClusterVirtualMachineRole -VirtualMachine IceCream

2. Configure Preferred Owner

Cmdlet :- Set-ClusterOwnerNode

Set-ClusterOwnerNode -Group Donut -Owner Server1
Set-ClusterOwnerNode -Group Exclair -Owner Server1
Set-ClusterOwnerNode -Group Froyo -Owner Server2
Set-ClusterOwnerNode -Group Gingerbread -Owner Server2
Set-ClusterOwnerNode -Group HoneyComb -Owner Server2
Set-ClusterOwnerNode -Group IceCream -Owner Server1

3. Configure Priority

Cmdlet:- Get-ClusterGroup.Priority

Value for :-

High – 3000

Medium –2000

Low - 1000

(Get-ClusterGroup Donut).Priority=3000
(Get-ClusterGroup Exclair).Priority=1000
(Get-ClusterGroup Froyo).Priority=2000
(Get-ClusterGroup Gingerbread).Priority=1000
(Get-ClusterGroup HoneyComb).Priority=1000
(Get-ClusterGroup IceCream).Priority=1000

4. Automatic Fallback

Cmdlet:- GetpClusterGroup.AutoFailbackType

Set value to 1 will configure as “Immediately” fallback

(Get-ClusterGroup Donut).AutoFailbackType=1
(Get-ClusterGroup Exclair).AutoFailbackType=1
(Get-ClusterGroup Froyo).AutoFailbackType=1
(Get-ClusterGroup Gingerbread).AutoFailbackType=1
(Get-ClusterGroup HoneyComb).AutoFailbackType=1
(Get-ClusterGroup IceCream).AutoFailbackType=1

In this Part 3, you have learned to add HA Virtual Machine to the cluster, set Preferred Owner, Priority and FallBack.

Now that is the end of this part on how to create virtual machine using Powershell. Hope you have learned a lot.

Relevant Post