Sysprep on windows 2003 r2 sp 2

This is only a note to remind me how to sysprep a windows server 2003.

To sysprep a windows 2003 R2 image, follow the below action :

  • Insert CD1
  • go to  Support\Tools\Deploy.cab
  • select everything and extract them to c:\sysprep ( a folder that you have created it)
  • Double click sysprep.exe.

041613_0450_syspreponwi1

  • Keep the default settings (Options un-selected, shutdown mode: shutdown)
  • click on Reseal

041613_0450_syspreponwi2

  • And press Ok

041613_0450_syspreponwi3

Set the default Organisational Unit for new computers in Windows Server

Once you have your domain and group policies set up, it can become frustrating to constantly have to remember to move a new computer into the correct OU.

Luckily in Windows 2003 Server and above, you can set a default OU:

  1. <code>redircmp ou=ComputersOU,dc=mydomain,dc=com</code>

Remember to replace the path with your own domain’s OU path. Also, your domain has to be running in at least Windows Server 2003 native mode – otherwise you will receive an error:

Error, unable to modify the wellKnownObjects attribute. Verify that the domain functional level of the domain is at least Windows Server 2003:
Unwilling To Perform
Redirection was NOT successful.

To change this:

  • On the server go to Administrative Tools > Active Directory Domains and Trusts.
  • Right-click on your domain name, and click on Raise Domain Functional Level.
  • Set the domain level to at least 2003

Now you should be ready to go!

Sysprep your Windows OS for more than 3 times

If you attempt to sysprep a machine for acquisition of an Image and the machine crashes during the sysprep process it is likely that the image has been sysprepped more than 3 times.

Symptoms of this issue

run sysprep.exe with /generalize /oobe switches and the process is running for few seconds when then the sysprep window disappears. Opening the sysprep log file under \sysprep\Panther the logfile contains this line:

Date Time, Error [0x0f0073] SYSPRPRunExternalDlls:Not running DLLs; either the machine is in an invalid state orwe couldn’t update the recorded state, dwRet = 31

This error indicates that the image has been syspreped more than 3 times

First check if you can re-arm by running:

slmgr.vbs /dlv

and check the re-arm counter. if it set to zero you need to do the following: http://support.microsoft.com/kb/929828 (set the <SkipRearm>1</SkipRearm> like in the example, note: this option will make the product key window to appear in the setup process).
You can also try running : slmgr.vbs -rearm, to rearm Windows.

Reset the sysprep count to zero

1 – Change few keys in the registry:

HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\GeneralizationState\CleanupState:2

HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\GeneralizationState\GeneralizationState:7

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\SkipRearm:1

2 – Reset MSDTC

Start -> Run : msdtc -uninstall (wait few seconds)

Start -> Run : msdtc -install (wait few seconds)

3 – Restart the machine
4 – You can now run:

sysprep.exe /generalize /oobe

 

VNC Deployment via Group Policy

I have had a few people ask how to deploy VNC via group policy. If you have a large network where you want to install VNC on a large amount of computers this would be an ideal solution.

For this guide i used TightVNC – the website is here: tightvnc.com

I decide to go for TightVNC becuase

  • Easy to use
  • Free
  • Ability to hide the icon in the system tray
  • Built in access control options
  • Very lightweight
  • Ability for the end user to approve connections
  • Fully compatible with Windows 7

I have tested this on the following systems

  • Windows XP x32
  • Windows 7 x32
  • Windows 7 x64
  • Windows 8 x32
  • Windows 8 x64
  • Windows 8.1 x32
  • Windows 8.1 x64
  • Windows Server 2008 R2

With the below guide, anything in red are paths you need to change to make it suitable for deployment in your network.
Once this script has installed VNC it is designed to automatically quit when you run it again.

Creating the installer files

  1. Create a network share on a server to store the script and installers. You will need to give the group “Domain Computers” the right to read and execute.
  2. Download TightVNC v2.0.2 and save it in the above share and install onto 1 computer.
  3. On the computer you installed TightVNC, configure to how you like it (eg set a password). Click Here for Documentation & Click Here for FAQ
  4. Once configured go to regedit and export the following folder. “HKEY_LOCAL_MACHINE\Software\TightVNC” & save it in the above share. To export right click the TightVNC folder and press export.
  5. Open NotePad and copy the below code. Please change the red areas to the path of your network share. The script will remove the VNC stuff from the program files to stop users from playing. If you do not want to do this remove the last line of the code.
    Code:
    if exist "C:\Program Files (x86)\TightVNC" goto :eof ELSE
    if exist "C:\Program Files\TightVNC" goto :eof ELSE
    "c:\vnc\tightvnc-2.0.2-setup.exe" /S
    regedit /S "c:\vnc\tightvnc.reg"
    net stop "TightVNC Server"
    net start "TightVNC Server"
    rmdir /s /q "C:\Documents and Settings\All Users\Start Menu\Programs\TightVNC\"
  6. Save the file in your shared folder. You need to save it as a .bat file. For example mine is called installvnc.bat

Adding to a group policy

  1. Open up an appropriate group policy that applied to your computers or create a new one.
  2. Navigate to: Computer Configuration > Policies > Windows Settings > Scripts > Startup
  3. Press add, then browse and find the .bat file we created before in the shared folder. Then press ok & ok again.
  4. Make sure the following group policy is enabled. Computer Configuration > Policies > Administrative Templates > System > Logon > Always wait for the network at computer startup & Logon

When your computer startup it should install VNC and be configured.

Enjoy!

Find Computer Name User is Logged Onto

To automatically log users that login to domain based computers:

  • Create a Share on a Server and give right NTFS and Share permissions
  • Create a Batch file in which you put this script: echo user: %username% computer: %computername% date: %date% >> \\Server\Share\info.txt
  • Use group policies to apply this Batch file as a logon script

At the end you will get in the text file info.txt:

  • The user name
  • The used computer
  • The date of logon

For instant discovery of what PC a user has logged into:

Right click My Computer – Click Manage – Expand Shared Folders – Click Sessions

This will provide the username and the IP of the PC they are logged into

You can then go to DHCP under Administrative Tools and view the leases to see the PC name

View from within Server 2008 R2:

425842

Windows Server – How to Re-Register an Active Directory Domain Controller DNS Records

An Active Directory domain controller (DC) registers quite a few resource records of different types in DNS. When troubleshooting a network, DNS, or Active Directory issue, it is sometimes necessary to manually re-register these records. This can be accomplished by following a few simple steps:

  1. Open an elevated command prompt.
  2. Type ipconfig /all and verify that the correct DNS servers are listed. A domain controller, like any other domain-joined machine, should use only DNS servers that are inside the domain.
    1376433217313.ipconfig-all
  3. Type ipconfig /flushdns to clear the DC’s resolver cache.
    1376433329486.flushdns
  4. Type ipconfig /registerdns to register the DC’s host and PTR records.
    1376433389628.registerdns
  5. To register the DC’s SRV records, type net stop netlogon and net start netlogon to restart the Net Logon service, which is responsible for registering those records.
    1376433459676.restart-netlogonAlternatively, open the Services console and restart the Net Logon service from there.
    1376433493363.restart-netlogon-gui
  6. Wait a few minutes, then check DNS to verify that the records have been registered.

For information on the DNS records registered by a DC, see DNS Records Registered by an Active Directory Domain Controller.

dig DNS query Tool for Windows

dig  for Windows  8, 7, Vista, XP, 2000  win98-logo windows vista-logo windows8

(dig is a powerful tool to investigate [digging into] the DNS system)

Source of the binary is from ftp.isc.org
Manual Page of dig, in the cryptic Unix style, for reference only.

(1) Download:
dig version 9.3.2
Create a folder   c:dig
Download dig-files3 and save it to c:dig
Use Open source 7-zip to extract all the files inside dig-files3.zip to c:dig

Note: If msvcr70.dll already exists in %systemroot%system32 , then you can delete c:digmsvcr70.dll

Note: Included in dig-files*.zip is a command line whois, version 4.7.30:
The canonical site of the whois source code is http://ftp.debian.org/debian/pool/main/w/whois/
The whois.exe file inside dig-files*.zip is compiled using cygwin’s gcc-mingw compiler.

(2) File integrity check (reason: some stupid anti-virus programs mis-identify certain dll files as virus and destroy them without giving warnings)
windows Windows XP and  win98-logo Windows 2000: Click Start.Run … type CMD
vista-logo Windows Vista and Windows 7: Click vista-logo … type CMD
cd   c:dig

sha1sum   *

You should see the SHA1 hashes (SHA1 hash is used as an integrity check, similar to the legacy checksum idea).
Compare your hashes with the following table.

C:dig>sha1sum *
489a8ca7c7851088ade58c404ddde1a926559003  cygwin1.dll
57487baeaa0eb2848557b7ca54ed9183eafc73fa  dig.exe
97dbd755d67a5829c138a4708be7a4f26ed0894c  host.exe
d22e4b8956e1831ff0f9d07620ec19bf171f0c29  libbind9.dll
81588f0be7d3c6b320edc314532d9f2d0a105594  libdns.dll
e0bd7187bbc01003abfe7472e64b68cd1bdb6bab  libeay32.dll
f445362e728a902796ec6871a79c6307054974e4  libisc.dll
b3255c0e4808a703f95c217a91ffcd6940e680c9  libisccfg.dll
dfbde4f9e25fd49a0846e97fd813d6876dc94067  liblwres.dll
61b8f573db448ae6351ae3475c2e7c482d81533c  msvcr70.dll
da39a3ee5e6b4b0d3255bfef95601890afd80709  resolv.conf
4a578ecd09a2d0c8431bdd8cf3d5c5f3ddcddfc9  sha1sum.exe
9d9ec0e2cf59e14d9db618d10b55b881bb7d195b  whois.exe

If your hashes are the same as the above table, then your files pass the integrity check.
Type exit to close the black screen.

(3) Installation and setup:

Windows Vista vista-logo Windows 7 windows_7
Install a Vista Powertoy utility:
File name: CmdHereAsAdmin (right click the link, choose save; then on your local copy, right click the .inf file, choose Install)
(Thanks to Aaron Spurlock of Ogden, UT, USA and Patryk Bratkowski for their contributions)
Click vista-logo …click Computer, click C:
right click on c:dig , choose Cmd Prompt Here As Administrator 
copy resolv.conf  %systemroot%system32driversetc

Windows XP windows Windows 2000 win98-logo
Click start…run… type  cmd 
cd c:dig
copy resolv.conf  %systemroot%system32driversetc

(4) Add path:
(thanks to Jason Partridge of Akento Technology Sourcing, Bloomington, IN, USA for his contribution)
Windows 7: Click vista-logo … type environment variables … choose “edit environment variables for your account
Windows Vista: 
Click vista-logo …click Control Panel, in the Search Box, type environment variables … choose “edit environment variables for your account
Windows XPwindows : Click..Start…click Control Panel …in Category “Performance and Maintenance“, SystemAdvancedEnvironment Variables.
Windows 2000win98-logo : right click My Computer icon, choose properties, Advanced, Environment Variables.

Look in the top half of the screen, “User variables” section.
If a PATH variable exists, double click the variable PATH to enter edit mode,
append  ;c:dig  to the Variable value.
If the PATH variable does not exist, click the New button,
Variable name:  PATH
Variable value:  c:dig


How to use dig to query the DNS system:

You can also use dig to help setting up your security camera system. First add a “A record” to your name server to point the “A record” of your chosen domain to an ip address. Make sure that the “A record” points to an ip address of your dvr recorder’s external ip address (or the D-Link/Linksys router that sits in front of your security device). If all is good and you have the necessary ports open or forwarded, you should be able to remotely access your security system over a network of Internet.

vista-logo  Windows Vista/Windows 7: Click vista-logo … type  cmd

windows Windows XP/Windows 2000 win98-logo : Click Start… Run… type  cmd

dig   –help will show you a “help screen” to intimidate and confuse you.
dig   -h will show you a even more intimidating “help screen”.
dig  ns . 
 will show you the 13 “root-level name servers”, these are the 13 Internet gods.


dig  com.  NS
shows you the (gTLD) top level domain name servers controlling the .com domain

dig  net. NS
shows you the (gTLD) top level name servers controlling the .net domain

dig  org.  NS
shows you the (gTLD) top level name servers controlling the .org domain

dig  gov. NS
shows you the (TLD) top level name servers controlling the .gov (US Government) restricted domain

dig  mil.  NS
shows you the (TLD) top level name servers controlling the .mil  (US military) restricted domain

dig  edu.  NS
shows you the (TLD) top level name servers controlling the .edu (US post secondary) restricted domain

dig  int. NS
shows you the (TLD) top level name servers controlling the .int (international treaties) restricted domain


Each country code has its authoritative name servers (below is some of the 244 ccTLD)

dig  ca. NS
shows you the top level name servers controlling the .ca (Canada ca ) domain

dig  us.  NS
shows you the top level name servers controlling the .us (US us ) domain

dig  uk. NS
shows you the top level name servers controlling the .uk (United Kingdom uk ) domain

dig  de. NS
shows you the top level name servers controlling the .de (Germany de ) domain

dig  au. NS
shows you the top level name servers controlling the .au (Australia au ) domain

dig  cn. NS
shows you the top level name servers controlling the .cn (China cn ) domain

dig  kr. NS
shows you the top level name servers controlling the .kr (Korea kr ) domain

dig  tw. NS
shows you the top level name servers controlling the .tw (Taiwan tw ) domain

dig  hk. NS
shows you the top level name servers controlling the .hk (Hong Kong hk ) domain

dig  gs. NS
shows you the top level name servers controlling the .gs (South Georgia and the South Sandwich Islands gs ) domain

dig  ws. NS
shows you the top level name servers controlling the .ws (Western Samoa ws ) domain,
some “domain registrars” confuse the public by inferring this domain as the “Website” top level domain.

dig  tv. NS
shows you the top level name servers controlling the .tv (Tuvalu tv ) domain,
some “domain registers” confuse the public by inferring this domain as the “Television” top level domain.

dig  ae. NS
shows you the top level name servers controlling the .ae (United Arab Emirates ae ) domain

dig  gr. NS
shows you the top level name servers controlling the .gr (Greece gr ) domain

dig  id.  NS
shows you the top level name servers controlling the .id (Indonesia id ) domain

dig  ru.  NS
shows you the top level name servers controlling the .ru (Russia ru ) domain


dig  aero. NS
shows you the (gTLD) top level name servers controlling the .aero domain (for aviation industry)

dig  biz. NS
shows you the (gTLD) top level name servers controlling the .biz domain (for businesses)

dig  coop. NS
shows you the (gTLD) top level name servers controlling the .coop domain  (for co-op associations)

dig  info. NS
shows you the (gTLD) top level name servers controlling the .info domain

dig  jobs. NS
shows you the (gTLD) top level name servers controlling the .jobs domain (for human resources)

dig  mobi. NS
shows you the (gTLD) top level name servers controlling the .mobi domain (for mobile products and services)

dig  museum. NS
shows you the (gTLD) top level name servers controlling the .museum domain (for museums)

dig  name. NS
shows you the (gTLD) top level name servers controlling the .name domain (for individuals)

dig  pro. NS
shows you the (gTLD) top level name servers controlling the .pro domain  (for credentialed professionals)

dig  travel. NS
shows you the (gTLD) top level name servers controlling the .travel domain  (for travel industry)

The Internet god approved these gTLD domains.

As of 2008, the Inernet god has changed its policy, anyone who can afford to pay lots of money each year can administer any name as a top level name.
In addition, non-Latin scripts are allowed.


More examples of how to use dig to query the DNS system:

dig  dell.com.  NS
shows you the Name Servers for “dell.com

dig  dell.com.  MX
shows you the mail servers for receiving email for the “dell.com” domain (geeky terminology: Mail eXchange ).
The mail server with the smallest number in front of it will be contacted first. If that mail server is down or busy,
the mail server with the larger number will be contacted next (for fault tolerant).

dig  www.dell.com. 
shows you the IP address of the computer www.dell.com (geeks call computer a “host)
(geeks also like to call www.dell.com a FQDN to intimidate others around them)

Sometimes you see the word CNAME in the answer section, CNAME is a geeky way of saying “an alias“.

dig  www.ibm.com.    @hub.ubc.ca
lookup the IP address of www.ibm.com by making a DNS query to the DNS server “hub.ubc.ca”

Most DNS name servers are recursive (friendly), they try to find an answer for you.
However, some “system administrators” suffering from extreme-paranoia configure their name servers to
refuse answering queries that are outside of their “comfort zones”.
These extreme-paranoia servers are called “non-recursive” (aka unfriendly) name servers.

dig   -x    216.21.128.22
will look up the “host name” from an IP address
(geeks call this a “reverse DNS lookup” to intimidate and impress others around them)
The equivalent human-friendly command is   
host  216.21.128.22

dig  www.ibm.com. +trace
will give you some DNS server performance data.


dig   vs   whois

The DNS system and the whois system are not the same, they are only loosely tied together.
If the whois system is broken, (while the DNS system is working) the whole Internet will work fine.
If the DNS system is broken (while the whois system is working), the whole Internet will die.

The whois system is supposed to display who owns the domain and their corresponding name servers,
however, due to usually defective software at whois servers at domain registrars,
(the amount of defects is proportional to the registrar’s domain registration fees),
the DNS name servers information obtained from the whois query is often wrong, out of date, and inaccurate.

Use whois to find out approximately who owns the domain.

Use dig to lookup the DNS name servers of that domain.

For example, to find out who owns the name ibm.com

whois   ibm.com

or

whois   ibm.com  |  more (hit space bar to scroll forward)

 

Public to Private Network in Windows 8 – 2012R2

In Windows 8, when you connect to a wireless network, it will either register it as a Public network or a Private network. Private networks are basically home and work whereas public is anywhere else. Sometimes Windows 8 or Windows Server detects a private network as a public one and vice versa. You can manually make some changes to ensure that you are not accidentally sharing either too much on a public network or blocking all sharing on a private network.

run-dialog

Then click on Network List Manager Policies at the left and on the right-hand side you should see a couple of items with descriptions and then something called Network, which is the current network you are connected to. It may also be called something else, but it doesn’t have a description.

network-list-manager-policies

Double-click on it and click on the Network Location tab. Here you can manually change the network location from Private to Public and vice versa.

network-location

Server 2012 Extend Volume Error ‘The Parameter is incorrect”

In Windows Server 2008R2 and beyond it has been possible to extend the system volume online and without needing to resort to third party tools which often required at least a reboot.

I’ve now used this feature many times, but yesterday I had an issue when extending the volume of a Windows Server 2012 system drive where it returned the horrible looking error below ‘The parameter is incorrect’.

DiskGrowParameterIncorrect

This leaves you in a scenario where the Disk Management tool reports that the disk has been increased to the new size, but viewing the disk properties in Explorer shows it has not been increased.

DiskSizeMisMatch1

Nicholas Schoonover has a post detailing the same issue and suggests fixing it by first shrinking the disk, then extending it again. There are also comments on that post which suggest that extending it further might also resolve it. I wasn’t particularly keen to try out either of those suggestions immediately so did a bit more research.

It turns out this has been an issue within Windows Server for sometime and this Microsoft KB article details how to resolve it with the Diskpart utility, essentially the disk partition has been increased, but not the file system size.

It’s as simple as

DISKPART> select volume #

where # is the number of the affected volume which can be found with list volume.

DISKPART> extend filesystem

Now the file system size should match the new partition size.

Failover Clustering for Hyper-V

Some veteran IT Pros hear the term ‘Microsoft Clustering’ and their hearts start racing.  That’s because once upon a time Microsoft Cluster Services was very difficult and complicated.  In Windows Server 2008 it became much easier, and in Windows Server 2012 it is now available in all editions of the product, including Windows Server Standard.  Owing to these two factors you are now seeing all sorts of organizations using Failover Clustering that would previously have shied away from it.

The service that we are seeing clustered most frequently in smaller organizations is Hyper-V virtual machines.  That is because virtualization is another feature that is really taking off, and the low cost of virtualizing using Hyper-V makes it very attractive to these organizations.

In this article I am going to take you through the process of creating a failover cluster from two virtualization hosts that are connected to a single SAN (storage area network) device.  However in Windows Server 2012 these are far from the limits.  You can actually cluster up to sixty-four servers together in a single cluster.  Once they are joined to the cluster we call them cluster nodes.

Failover Clustering in Windows Server 2012 allows us to create highly available virtual machines using a method called Active-Passive clustering.  That means that your virtual machine is active on one cluster node, and the other nodes are only involved when the active node becomes unresponsive, or if a tool that is used to dynamically balance the workloads (such as System Center 2012 with Performance and Resource Optimization (PRO) Tips) initiates a migration.

In addition to using SAN disks for your shared storage, Windows Server 2012 also allows you to use Storage Pools.  I explained Storage Pools and showed you how to create them in my article Storage Pools I also explained how to create a virtual SAN using Windows Server 2012 in my article iSCSI Storage in Windows Server 2012.  For the sake of this article, we will use the simple SAN target that we created together in that article.

Step 1: Enabling Failover Clustering

Failover Clustering is a feature on Windows Server 2012.  In order to enable it we will use the Add Roles and Featureswizard.

1. From Server Manager click Manage, and then select Add Roles and Features.

2. On the Before you begin page click Next>

3. On the Select installation type page select Role-based or feature-based installation and click Next>

4. On the Select destination server page select the server onto which you will install the role, and click Next>

5. On the Select server roles page click Next>

6. On the Select features page select the checkbox Failover Clustering.  A pop-up will appear asking you to confirm that you want to install the MMC console and management tools for Failover Clustering.  Click Add Features.  ClickNext>

7. On the Confirm installation selections page click Install.

NOTE: You could also add the Failover Clustering feature to your server using PowerShell.  The script would be:

Install-WindowsFeature -Name Failover-Clustering –IncludeManagementTools

If you want to install it to a remote server, you would use:

Install-WindowsFeature -Name Failover-Clustering –IncludeManagementTools –ComputerName <servername>

That is all that we have to do to enable Failover Clustering in our hosts.  Remember though, it does have to be done on each server that will be a member of our cluster.

Step 2: Creating a Failover Cluster

Now that Failover Clustering has been enabled on the servers that we want to join to the cluster, we have to actually create the cluster.  This step is easier than it ever was, although you should take care to follow the recommended guidelines.  Always run the Validation Tests (all of them!), and allow Failover Cluster Manager to determine the best cluster configuration (Node Majority, Node and Disk Majority, etc…)

NOTE: The following steps have to be performed only once – not on each cluster node.

1. From Server Manager click Tools and select Failover Cluster Manager from the drop-down list.

2. In the details pane under Management click Create Cluster…

3. On the Before you begin page click Next>

4. On the Select Servers page enter the name of each server that you will add to the cluster and click Add.  When all of your servers are listed click Next>

5. On the Validation Warning page ensure the Yes. When I click Next, run configuration validation tests, and then return to the process of creating the cluster radio is selected, then click Next>

6. On the Before You Begin page click Next>

7. On the Testing Options page ensure the Run all tests (recommended) radio is selected and then click Next>

8. On the Confirmation page click Next> to begin the validation process.

9. Once the validation process is complete you are prompted to name your cluster and assign an IP address.  Do so now, making sure that your IP address is in the same subnet as your nodes.

NOTE: If you are not prompted to provide an IP address it is likely that your nodes have their IP Addresses assigned by DHCP.

10. On the Confirmation page make sure the checkbox Add all eligible storage is selected and click Next>.  The cluster will now be created.

11. Click on Finish.  In a few seconds your new cluster will appear in the Navigation Pane.

Step 3: Configuring your Failover Cluster

Now that your failover cluster has been created there are a couple of things we are going to verify.  The first is in the main cluster screen.  Near the top it should say the type of cluster you have.

If you created your cluster with an even number of nodes (and at least two shared drives) then the type should be anode and disk majority.  In a Microsoft cluster health is determined when a majority (50% +1) of votes are counted.  Every node has a vote.  This means that if you have an even number of nodes (say 10) and half of them (5) go offline then your cluster goes down.  If you have ten nodes you would have long since taken action, but imagine you have two nodes and one of them goes down… that means your entire cluster would go down.  So Failover Clustering uses node and disk majority – it takes the smallest drive shared by all nodes (I usually create a 1GB LUN) and configures it as the Quorum drive – it gives it a vote… so if one of the nodes in your two node cluster goes down, you still have a majority of votes, and your cluster stays on-line.

The next thing that you want to check is your nodes.  Expand the Nodes tree in the navigation pane and make sure that all of your nodes are up.

Once this is done you should check your storage.  Expand the Storage tree in the navigation pane, and then expandDisks.  If you followed my articles you should have two disks – one large one (mine is 140GB) and a small one (mine is 1GB).  The smaller disk should be marked as assigned to Disk Witness in Quorumand the larger disk will be assigned toAvailable Storage.

Cluster Shared Volumes was introduced in Windows Server 2008R2.  It creates a contiguous namespace for your SAN LUNs on all of the nodes in your cluster.  In other words, rather than having to ensure that all of your LUNs have the same drive letter on each node, CSVs create a link – a portal if you will – on your C: under the directoryC:\ClusterStorage.  Each LUN would have its own subdirectory – C:\ClusterStorage\Volume1,C:\ClusterStorage\Volume2, and so on.  However using CSVs means that you are no longer limited to a single VM per LUN, so you will likely need fewer.

CSVs are enabled by default, and all you have to do is right-click on any drive assigned to Available Storage, and clickAdd to Cluster Shared Volumes.  It will only take a second to work.

NOTE: While CSVs create directories on your C drive that is completely navigable, it is never a good idea to use it for anything other than Hyper-V.  No other use is supported.

Step 4: Creating a Highly Available Virtual Machine (HAVM)

Virtual machines are no different to Failover Cluster Manager than any other clustered role.  As such, that is where we create them!

1. In the navigation pane of Failover Cluster Manager expand your cluster and click Roles.

2. In the Actions Pane click Virtual Machines… and click New Virtual Machine.

3. In the New Virtual Machine screen select the node on which you want to create the new VM and click OK.

The New Virtual Machine Wizard runs just like it would in Hyper-V Manager.  The only thing you would do differently here is change the file locations for your VM and VHDX files.  In the appropriate places ensure they are stored under C:\ClusterStorage\Volume1.

At this point your highly available virtual machine has been created, and can be failed over without delay!

 

Step 5: Making an existing virtual machine highly available

In all likelihood you are not starting from the ground up, and you probably have pre-existing virtual machines that you would like to add to the cluster.  No problem… However before you go, you need to put the VM’s storage onto shared storage.  Because Windows Server 2012 includes Live Storage Migration it is very easy to do:

1. In Hyper-V Manager right-click the virtual machine that you would like to make highly available and click Move

2. In the Choose Move Type screen select the radio Move the virtual machine’s storage and click Next>

3. In the Choose Options for Moving Storage screen select the radio marked Move all of the virtual machine’s data to a single location and click Next>

4. In the Choose a new location for virtual machine type C:\ClusterStorage\Volume1 into the field.  Alternately you could click Browse… and navigate to the shared file location.  Then click Next>

5. On the Completing Move Wizard page verify your selections and click Finish.

Remember that moving a running VM’s storage can take a long time.  The VHD or VHDX file could theoretically behuge… depending on the size you selected.  Be patient, it will just take a few minutes.  Once it is done you can continue with the following steps.

6. In Failover Cluster Manager navigate to the Roles tab.

7. In the Actions Pane click Configure Role…

8. In the Select Role screen select Virtual Machine from the list and click Next>.  This step can take a few minutes… be patient!

9. In the Select Virtual Machine screen select the virtual machine that you want to make highly available and clickNext>

NOTE: A great improvement in Windows Server 2012 is the ability to make a VM highly available regardless of its state.  In previous versions you needed to shut down the VM to do this… no more!

10. On the Confirmation screen click Next>

…That’s it! Your VM is now highly available.  You can navigate to Nodes and see which server it is running on.  You can also right-click on it, click Move, select Live Migration, and click Select Node.  Select the node you want to move it to, and you will see it move before your very eyes… without any downtime.

What? There’s a Video??

Yes, We wanted you to read through all of this, but we also wrote it as a reference guide that you can refer to when you try to build it yourself.  However to make your life slightly easier, we also created a video for you and posted it online.  Check it out!

Creating and configuring Failover Clustering for Hyper-V in Windows Server 2012

 

For Extra Credit!

Now that you have added your virtualization hosts as nodes in a cluster, you will probably be creating more of your VMs on Cluster Shared Volumes than not.  In the Hyper-V Settings you can change the default file locations for both your VMs and your VHDX files to C:\ClusterStorage\Volume1.  This will prevent your having to enter them each time.

As well, the best way to create your VMs will be in the Failover Cluster Manager and not in Hyper-V Manager.  FCM creates your VMs as HAVMs automatically, without your having to perform those extra steps.

Conclusion

Over the last few weeks we have demonstrated how to Create a Storage Pool, perform a Shared Nothing Live MigrationCreate an iSCSI Software Target in Windows Server 2012, and finally how to create and configure Failover Clusters in Windows Server 2012.  Now that you have all of this knowledge at your fingertips (Or at least the links to remind you of it!) you should be prepared to build your virtualization environment like a pro.  Before you forget what we taught you, go ahead and do it.  Try it out, make mistakes, and figure out what went wrong so that you can fix it.  In due time you will be an expert in all of these topics, and will wonder how you ever lived without them.  Good luck, and let us know how it goes for you!