You are here:   Home
Jul
09
2010

PowerShell for Failover Clustering: Webcast Follow up

Hi Cluster Fans,

 

Thanks for those of you who attended my webcast on PowerShell a few weeks ago.  If you didn’t have a chance to attend, here is the link to the event: https://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?culture=en-US&EventID=1032448852&CountryCode=US

 

One of the requests I got was to share the sample scripts.  With pleasure!  Here they are.

·         Demo 1: http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-73-13/8206.demo1.txt

·         Demo 2: http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-73-13/8306.demo2.txt

·         Demo 3: http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-73-13/4034.demo3.txt

·         Demo 4: http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-73-13/7563.demo4.txt

 

As for the Start-Demo script I used, you’ll find it here: http://blogs.msdn.com/b/powershell/archive/2007/03/03/start-demo-help-doing-demos-using-powershell.aspx


A big thank you to Jeffrey Snover for making it easier for me (and others who use this all the time)!

 

Our other recent webcasts are listed here: http://blogs.msdn.com/b/clustering/archive/2010/04/16/9997525.aspx

 

Have fun!

Ahmed Bisht

Senior Program Manager

Clustering & High-Availability

Microsoft

PowerShell for Failover Clustering: Webcast Follow up
read full article at source
 
Jul
09
2010

New Clustering Utility – Remote Desktop Connection Manager

Hi Cluster Fans,

We wanted to let you know about a new tool which will significantly help you manage your cluster deployments.  Remote Desktop Connection Manager is actually not cluster-specific, but it allows you to logically group server remote desktop connections – ideal if you are working with clusters for easy access to all the nodes within the cluster.


Get it for free here: http://www.microsoft.com/downloads/details.aspx?FamilyID=4603c621-6de7-4ccb-9f51-d53dc7e48047&displaylang=en


This tool has been used internally by Microsoft for several years, so we are happy to bring it to our customers to make their datacenter management experience even easier.

In my environment, I manage several clusters for our team to test and verify customer issues on previously-released versions of Windows Server.  I am currently managing a 2003 MSCS Cluster, 2008 SP2 Failover Cluster, 2008 R2 Failover Cluster, my development cluster, as well as a Network Load Balancing (NLB) Cluster.  I have also set up easy connections to other team members’ clusters in case I need a ‘backup cluster’ for a demo or want to test a migration between clusters.  The screenshot below shows some of the flexibility you have with grouping servers using Remote Desktop Connection Manager:


                New Clustering Utility – Remote Desktop Connection Manager

 

You also have the ability to connect to or disconnect from an entire group at once:


                New Clustering Utility – Remote Desktop Connection Manager

 

Another great thing about this tool is that it remembers your permissions when you connect to the nodes, so each subsequent time you connect, you do not need to provide a password, just double-click on the server name you wish to connect to.  Additionally this password can be applied to the entire group for an easy log-in experience:


                New Clustering Utility – Remote Desktop Connection Manager

 

Remote Desktop Connection Manager also gives you the ability to assign each server a ‘friendly name’, which is local to your machine, so you easily ‘rename’ the servers to what is convenient for you.  Additionally, you have the ability to save the configuration file, so that you can export it to other management machines or save a backup of your customized layout:

                New Clustering Utility – Remote Desktop Connection Manager

 

Try it out – it will save you a lot of time with multi-cluster and multi-server configurations.


Get it for free from here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=4603c621-6de7-4ccb-9f51-d53dc7e48047&displaylang=en

 

Thanks,
Symon Perriman
Program Manager II
Clustering & High-Availability
Microsoft

New Clustering Utility – Remote Desktop Connection Manager
read full article at source
 
Jul
09
2010

PowerShell for Failover Clustering: CSV Free Disk Space (and other info)

Hi Cluster PowerShell script writers,

We regularly get asked about how to find the free disk space on Cluster Shared Volumes (CSV). In this blog, I will show you how to do this with PowerShell.

Here are the CSV volumes in my cluster. Note that Cluster Disk 10 has two partitions.

PowerShell for Failover Clustering: CSV Free Disk Space (and other info)

 

To find the free disk space through PowerShell, the information is available inside the objects returned by Get-ClusterSharedVolume. You can easily see that information by piping the output to Format-Custom: PS> Get-ClusterSharedVolume "Cluster Disk 1" | fc *


Here is an example. Note that I’m just getting this information for one CSV disk (Cluster Disk 1), but you can also get it for all CSVs on the cluster by running:
PS > Get-ClusterSharedVolume | fc *


Now let’s look at the full output:

PS C:\> Get-ClusterSharedVolume "Cluster Disk 1" | fc *

 

class ClusterSharedVolume

{

  Name = Cluster Disk 1

  State = Online

  OwnerNode =

    class ClusterNode

    {

      Name = ahmedbc1-n2

      State = Up

    }

  SharedVolumeInfo =

    [

      class ClusterSharedVolumeInfo

      {

        FaultState = NoFaults

        FriendlyVolumeName = C:\ClusterStorage\Volume2

        Partition =

          class ClusterDiskPartitionInfo

          {

            Name = \\?\Volume{ef349066-525c-11df-8261-001e4fe757b6}

            DriveLetter =

            DriveLetterMask = 0

            FileSystem = NTFS

            FreeSpace = 17665183744

            MountPoints =

              [

              ]

            PartitionNumber = 1

            PercentFree = 84.24681

            Size = 20968370176

            UsedSpace = 3303186432

            HasDriveLetter = False

            IsCompressed = False

            IsDirty = Unknown

            IsFormatted = True

            IsNtfs = True

            IsPartitionNumberValid = True

            IsPartitionSizeValid = True

          }

        PartitionNumber = 1

        VolumeOffset = 1048576

        MaintenanceMode = False

        RedirectedAccess = False

      }

    ]

  Id = 3b115c10-95ab-4420-8e58-da1d988c7750

}

 


As you see, the information is not easy to find because you have to look through the nested objects and the default formatting is not nice. For example, I’m sure you want to see the size in GB not bytes!


Here is a “one line” command that gives you some information:

PS C:\> Get-ClusterSharedVolume | select -Expand SharedVolumeInfo | select -Expand Partition | ft -a

uto Name,@{ Label = "Size(GB)" ; Expression = { "{0:N2}" -f ($_.Size/1024/1024/1024) } },@{ Label =

"FreeSpace(GB)" ; Expression = { "{0:N2}" -f ($_.FreeSpace/1024/1024/1024) } },@{ Label= "UsedSpace(

GB)" ; Expression = { "{0:N2}" -f ($_.UsedSpace/1024/1024/1024) } },@{ Label = "PercentFree" ; Expre

ssion = { "{0:N2}" -f ($_.PercentFree) } }

 

Name                                             Size(GB) FreeSpace(GB) UsedSpace(GB) PercentFree

----                                             -------- ------------- ------------- -----------

\\?\Volume{ef349066-525c-11df-8261-001e4fe757b6} 19.53    16.45         3.08          84.25

\\?\Volume{297b7d61-62d5-11df-91ff-001e4fe757b6} 0.49     0.46          0.03          93.95

\\?\Volume{297b7d68-62d5-11df-91ff-001e4fe757b6} 0.49     0.46          0.03          93.91

\\?\Volume{ef349070-525c-11df-8261-001e4fe757b6} 19.53    19.44         0.09          99.55

\\?\Volume{ef34907a-525c-11df-8261-001e4fe757b6} 19.53    15.78         3.75          80.80

\\?\Volume{ef3490a2-525c-11df-8261-001e4fe757b6} 0.97     0.93          0.04          95.91

 

The problem with this is that it does not give you the friendly name given the nested nature of the objects returned with Get-ClusterSharedVolume. To do a better job displaying the information, I created this script that will display the information in a better view, which is attached to this blog post.  Please download the DisplayCSVInfo.txt file and rename it as a DisplayCSVInfo.ps1 file.  This is an unsupported script by Microsoft and should be used at your own risk.

PS C:\> .\DisplayCSVInfo.ps1

 

Name            Path                      Size(GB) FreeSpace(GB) UsedSpace(GB) PercentFree

----            ----                      -------- ------------- ------------- -----------

Cluster Disk 1  C:\ClusterStorage\Volume2 19.53    16.45         3.08          84.25

Cluster Disk 10 C:\ClusterStorage\Volume6 0.49     0.46          0.03          93.95

Cluster Disk 10 C:\ClusterStorage\Volume7 0.49     0.46          0.03          93.91

Cluster Disk 2  C:\ClusterStorage\Volume3 19.53    19.44         0.09          99.55

Cluster Disk 3  C:\ClusterStorage\Volume4 19.53    15.78         3.75          80.80

Cluster Disk 7  C:\ClusterStorage\Volume5 0.97     0.93          0.04          95.91



Happy scripting!

Regards,


Ahmed Bisht

Senior Program Manager

Clustering & High-Availability

Microsoft

PowerShell for Failover Clustering: CSV Free Disk Space (and other info)
read full article at source
 
Jul
09
2010

PowerShell for Failover Clustering: Creating Highly Available Workloads

Hi Clustering PowerShell Scripters,

 

One of the things we’ve provided in Failover Clustering PowerShell is a set of CMDlets to easily create highly available workloads in a cluster.

 

PS C:\Windows\system32> Get-Command -Module FailoverClusters | ?{ $_.Name -like "Add-Cluster*Role" }

CommandType     Name                                                Definition

-----------     ----                                                ----------

CMDlet          Add-ClusterFileServerRole                           Add-ClusterFileServerRole [[-Name] <String>] [-S...

CMDlet          Add-ClusterGenericApplicationRole                   Add-ClusterGenericApplicationRole [[-Name] <Stri...

CMDlet          Add-ClusterGenericScriptRole                        Add-ClusterGenericScriptRole [[-Name] <String>] ...

CMDlet          Add-ClusterGenericServiceRole                       Add-ClusterGenericServiceRole [[-Name] <String>]...

CMDlet          Add-ClusterPrintServerRole                          Add-ClusterPrintServerRole [[-Name] <String>] [-...

CMDlet          Add-ClusterServerRole                               Add-ClusterServerRole [[-Name] <String>] [-Stora...

CMDlet          Add-ClusterVirtualMachineRole                       Add-ClusterVirtualMachineRole [[-Name] <String>]...

 

Each of the above CMDlets takes care of:

·         Creating the cluster group

·         Moving disk resource(s) into the group

·         Creating resources which may include creating the correct IP resources depending on your cluster network configuration (number of IPs and DHCP vs. static IPs)

·         Setting properties for each resource created

·         Setting dependencies between resources

·         Bringing the resources online

 

With that said, you’ll notice that we have not provided a CMDlet for each and every clustered workload we can create through our HA Wizard in our Failover Cluster Manager GUI.

 

PowerShell for Failover Clustering: Creating Highly Available Workloads 

 

In this blog, I will show you how easy it is to create other workloads using PowerShell without the extra steps above.  The secret lies in the Add-ClusterServerRole CMDlet.

To illustrate this, I’ll be using the Microsoft Distributed Transaction Coordinator, MSDTC, role as an example. That might be useful if you’re trying to automate your SQL Server installs. Note that while this is focused on MSDTC, you can use the same concepts for other workloads.

 

For comparison purposes, I created a DTC workload named ahmedbc4Dtc on my cluster using the Failover Cluster Manager GUI. As seen here, that populated the group with the right resources and the correct dependencies between the resources.

 

PS C:\Windows\system32> Get-ClusterGroup ahmedbc4Dtc

Name                                    OwnerNode

----                                    ---------

ahmedbc4Dtc                             ahmedbc4-n2

 

PS C:\Windows\system32> Get-ClusterGroup ahmedbc4Dtc | Get-ClusterResource | ft -auto

Name                                                State  Group       ResourceType

----                                                -----  -----       ------------

ahmedbc4Dtc                                         Online ahmedbc4Dtc Network Name

Cluster Disk 6                                      Online ahmedbc4Dtc Physical Disk

IP Address 157.55.88.0 (2)                          Online ahmedbc4Dtc IP Address

IP Address 2001:4898:0:fff:200:5efe:157.55.88.0 (2) Online ahmedbc4Dtc IPv6 Tunnel Address

IP Address 2001:4898:f0:1000:: (2)                  Online ahmedbc4Dtc IPv6 Address

MSDTC-ahmedbc4Dtc                                   Online ahmedbc4Dtc Distributed Transaction Coordinator

 

PS C:\Windows\system32> Get-ClusterGroup ahmedbc4Dtc | Get-ClusterResource | Get-ClusterResourceDependency | ft -auto

Resource                                            DependencyExpression

--------                                            --------------------

ahmedbc4Dtc                                         [IP Address 157.55.88.0 (2)] or [IP Address 2001:4898:f0:1000:: ...

Cluster Disk 6

IP Address 157.55.88.0 (2)

IP Address 2001:4898:0:fff:200:5efe:157.55.88.0 (2) ([IP Address 157.55.88.0 (2)])

IP Address 2001:4898:f0:1000:: (2)

MSDTC-ahmedbc4Dtc                                   ([ahmedbc4Dtc]) and ([Cluster Disk 6])

 

Now, how can I create something similar with PowerShell?

 

The easiest way is to create a base server role with the Add-ClusterServerRole CMDlet. I named it ahmedbc4Dtc1. This CMDlet does the heavy weight lifting for you, including creating the right number of IP resources and whether they are DHCP or statically configured based on your cluster networking configuration.  It also moves the disk resource for you in the group and sets the right dependencies between the network name resource and the IP resources created.

 

PS C:\Windows\system32> Add-ClusterServerRole -Name ahmedbc4Dtc1 -Storage "Cluster Disk 7"

Name                                    OwnerNode                                                                 State

----                                    ---------                                                                 -----

ahmedbc4Dtc1                            ahmedbc4-n2                                                              Online

 

PS C:\Windows\system32> Get-ClusterGroup ahmedbc4Dtc1 | Get-ClusterResource | ft -auto

Name                                                State  Group        ResourceType

----                                                -----  -----        ------------

ahmedbc4Dtc1                                        Online ahmedbc4Dtc1 Network Name

Cluster Disk 7                                      Online ahmedbc4Dtc1 Physical Disk

IP Address 157.55.88.0 (3)                          Online ahmedbc4Dtc1 IP Address

IP Address 2001:4898:0:fff:200:5efe:157.55.88.0 (3) Online ahmedbc4Dtc1 IPv6 Tunnel Address

IP Address 2001:4898:f0:1000:: (3)                  Online ahmedbc4Dtc1 IPv6 Address

 

PS C:\Windows\system32> Get-ClusterGroup ahmedbc4Dtc1 | Get-ClusterResource | Get-ClusterResourceDependency | ft -auto

Resource                                            DependencyExpression

--------                                            --------------------

ahmedbc4Dtc1                                        [IP Address 157.55.88.0 (3)] or [IP Address 2001:4898:f0:1000:: ...

Cluster Disk 7

IP Address 157.55.88.0 (3)

IP Address 2001:4898:0:fff:200:5efe:157.55.88.0 (3) ([IP Address 157.55.88.0 (3)])

IP Address 2001:4898:f0:1000:: (3)

 

Notice it is missing the DTC resource.  So, just add that to the group and add the right dependency.  In this case, the DTC resource depends on a disk resource and network name resource as you can see above with the group I created earlier for comparison purposes through the GUI.

 

PS C:\Windows\system32> Get-ClusterGroup ahmedbc4Dtc1 | Add-ClusterResource -Name MSDTC-ahmedbc4Dtc1 -ResourceType "Dist

ributed Transaction Coordinator"

Name                          State                         Group                         ResourceType

----                          -----                         -----                         ------------

MSDTC-ahmedbc4Dtc1            Offline                       ahmedbc4Dtc1                  Distributed Transaction Co...

 

PS C:\Windows\system32> Add-ClusterResourceDependency MSDTC-ahmedbc4Dtc1 ahmedbc4Dtc1

Name                          State                         Group                         ResourceType

----                          -----                         -----                         ------------

MSDTC-ahmedbc4Dtc1            Offline                       ahmedbc4Dtc1                  Distributed Transaction Co...

 

PS C:\Windows\system32> Add-ClusterResourceDependency MSDTC-ahmedbc4Dtc1 "Cluster Disk 7"

Name                          State                         Group                         ResourceType

----                          -----                         -----                         ------------

MSDTC-ahmedbc4Dtc1            Offline                       ahmedbc4Dtc1                  Distributed Transaction Co...

 

PS C:\Windows\system32> Get-ClusterGroup ahmedbc4Dtc1 | Get-ClusterResource | Get-ClusterResourceDependency | ft -auto

Resource                                            DependencyExpression

--------                                            --------------------

ahmedbc4Dtc1                                        [IP Address 157.55.88.0 (3)] or [IP Address 2001:4898:f0:1000:: ...

Cluster Disk 7

IP Address 157.55.88.0 (3)

IP Address 2001:4898:0:fff:200:5efe:157.55.88.0 (3) ([IP Address 157.55.88.0 (3)])

IP Address 2001:4898:f0:1000:: (3)

MSDTC-ahmedbc4Dtc1                                  ([ahmedbc4Dtc1]) and ([Cluster Disk 7])

 

And, now, I’ll online the group.

 

PS C:\Windows\system32> Start-ClusterGroup ahmedbc4Dtc1

Name                                    OwnerNode                                            State

----                                    ---------                                            -----

ahmedbc4Dtc1                            ahmedbc4-n2                                          Online

 

 

That’s all for the group. But, one thing you’ll notice in the Failover Cluster Manager is the difference between the group the GUI created and the one I just created with PowerShell.  Notice the nice icon for the DTC group (icon beside the group name and type on the tabular view in the first diagram) and the “Manage MSDTC” action link (in the second diagram).

 

PowerShell for Failover Clustering: Creating Highly Available Workloads 

 

The reason this is not the same with the group I created via PowerShell is that I didn’t set the group type for the group properly when I added the DTC resource to the group.

 

PS C:\Windows\system32> gwmi -Namespace root/MSCluster -Class MSCluster_ResourceGroup | ?{ $_.Name -eq "ahmedbc4Dtc" } |

 fl Name,GroupType

Name      : ahmedbc4Dtc

GroupType : 103

 

PS C:\Windows\system32> gwmi -Namespace root/MSCluster -Class MSCluster_ResourceGroup | ?{ $_.Name -eq "ahmedbc4Dtc1" }

| fl Name,GroupType

Name      : ahmedbc4Dtc1

GroupType : 9999

 

To “fix” this up, set the group type via WMI.

 

PS C:\Windows\system32> ( gwmi -Namespace root/MSCluster -Class MSCluster_ResourceGroup | ?{ $_.Name -eq "ahmedbc4Dtc1"

} ).SetGroupType(103)

 

Now, you’re set.

 

PowerShell for Failover Clustering: Creating Highly Available Workloads 

 

Happy scripting!

 

Regards,

Ahmed Bisht

Senior Program Manager

Clustering & High-Availability

Microsoft

 

PowerShell for Failover Clustering: Creating Highly Available Workloads
read full article at source
 
Jul
09
2010

Hyper-V Backup Deep Dive: A Look Under the Hood

This presentation covers the internals and subtle nuances of how backing up Hyper-V works in Windows Server 2008 R2 in standalone as well as clustered environments that use clustered shared volume (CSV). Additionally, this presentation covers how one may build additional enterprise backup features like off-host backup and centralized backup server capabilities when Hyper-V and CSV are clubbed with storage management features like LUN Resync/LUN Swap.

Hyper-V Backup Deep Dive: A Look Under the Hood

Hyper-V Backup Deep Dive: A Look Under the Hood
Hyper-V Backup Deep Dive: A Look Under the Hood

Hyper-V Backup Deep Dive: A Look Under the Hood
read full article at source
 
Jul
09
2010

Hyper-V versus vSphere Snapshots, and why not use snapshots as a backup solution

Snapshots “made by hyper-v”, called Checkpoints, work a bit different way than the snapshots in VMware vSphere. Administrator managing Hyper-V not being aware  that the checkpoints are merged only when the VM is powered down, could find himself short on storage space. In fact as I saw in Eric Gray’s article, the VM shows that there are no checkpoints, but the space occupied with the checkpoints  is still used until the VM is powered off. Only after the merge operation is completed.

But it’s not this point which triggered my article about snapshots today. It’s the way we use them. Read on..

Hyper-V versus vSphere Snapshots, and why not use snapshots as a backup solution

Hyper-V versus vSphere Snapshots, and why not use snapshots as a backup solution
Hyper-V versus vSphere Snapshots, and why not use snapshots as a backup solution

Hyper-V versus vSphere Snapshots, and why not use snapshots as a backup solution
read full article at source
 
StartPrev31323334353637383940NextEnd

Hi, my name is Misha Hanin. I have served as an IT Network Administrator and IT Consultant for over 15 years. I have a number of certifications including CNE, Citrix CCA, VMWare VCP, MCP+I, MCSE, MCTS, MCITP Enterprise Messaging Administrator & MCITP Enterprise Administrator .

Microsoft presented me with the 2008 Microsoft® MVP Award (MVP) in Windows Server - Admin Frameworks! More...




Subscribe to CuruIT
Get tips, news and tutorials via RSS, Email or Twitter

Enter your email address:


Subscribe to my news feed for free Follow me on Twitter! Become a CuruIT fan on Facebook :) Become a CuruIT fan on YouTube :)