Live Growing Virtual Disks In HyperV 2012R2

This is a new feature instroduced in HyperV 2012R2.  Previous to R2 the virtual machine had to be shutdown prior to resizing the VHDX file (VHD does NOT support this). Quite a hassle if you are a non-stop-shop! The process is a little different if you need to Grow or Shrink the volumes but i’ll step you all the way through!

Lets start by Live Growing the disk!

  1. On the HyperV server, start PowerShell (PS) as Administrator
  2. Locate your VHD(X) file.
  3. Assume we want a new size of 20GB, type “Resize-VHD <filename> -SizeBytes 20GB”, hit Enter and relax.
  4. When PS is done the new size will be 20GB. Easy!
  5. Now log on to the guest VM.
  6. Type “Windows+R” and in the Run dialog type “diskmgmt.msc” and hit Enter.
  7. In Disk Management locate the disk to Grow and note that there should be some “white” space available to the right side of the bar.
  8. Right click on the partition and select “Extend Volume…”, Next, Select new size, Next, Finish
  9. Now allow windows to repartition the drive for you, this should go quite fast. And you’re set. Check the new size in explorer.
  10. If you want to, steps 6-9 can be replaced with the new kid on the block, the mighty PowerShell
    1. Start PowerShell as Administrator
    2. Type “Get-Volume”, take note of the driveletter
    3. Setup a variable, Type “$newsize=(Get-PartitionSupportedSize – DriveLetter <DriveLetter>”
    4. OPTIONAL: Check that the variable contains data, Type “write-host $newsize”
    5. Resize partition, Type “Resize-Partition -DriveLetter <DriveLetter> -Size $newsize.sizemax
    6. Type “Get-Volume” and verify size! Done!

 

 

DFS Namespace and Replication

There seems to be virtually no information regarding this issue on the web so I’ll post this as note2self.

======== SITE SETUP ==========

We are a 2 site setup, SiteA in europe and SiteB in asia. SiteA is the HQ and SiteB has a lot of subcontractors working there with AutoCad files.

– At SiteA we have a server hosting a share with a lot of files and folders, I will simplify the structure to [\\ServerA\Data\Subfolder1\Subfolder2\Subfolder3].

– SiteA also has DFS-N setup as [\\domain.local\SiteA\Data] pointing to [\\ServerA\Data]. This allows all users regardless of site to access ServerA’s data through DFS-N.

Contained in [Subfolder3] is large data that we would like to replicate to SiteB to speedup data access for asia users. So we have setup a share on SiteB [\\ServerB\DFSData\Subfolder3] and are using DFS-R to replicate data to that share from [\\ServerA\Data\Subfolder1\Subfolder2\Subfolder3]. This works fine. All files are replicated.

We also setup a common drive mapping for both sites [G:\] that uses DFS-N path [\\domain.local\SiteA\Data] as entry point. This means that both sites now can access [Subfolder3] through [G:\\Subfolder1\Subfolder2\Subfolder3].

========= SITE SETUP END ==========

It seem DFS-N and DFS-R must use the same entry path for DFS to access the correct server. This demands using two (2) drive mappings to solve the above problem. Let me make a simple example from the post above.

CORRECT use of DFS-N/R to solve OP problem

Mapped Drive 1: G:\ = \\domain.local\SiteA\Data

  • DFS-N Path: \\ServerA\Data
  • DFS-N: \\domain.local\SiteA\Data
  • DFS-R: Not activated on this DFS-N

Mapped Drive 2: R:\ = \\domain.local\SiteA\Subfolder3

  • DFS-N Path: \\ServerA\Data\Subfolder1\Subfolder2\Subfolder3
  • DFS-N Name: \\domain.local\SiteA\Subfolder3
  • DFS-R Pri: \\ServerA\Data\Subfolder1\Subfolder2\Subfolder3
  • DFS-R Sec: \\ServerB\DFSData\Subfolder3

NON WORKING EXAMPLE

Mapped Drive 1: G:\ = \\domain.local\SiteA\Data

  • Share: \\ServerA\Data
  • DFS-N: \\domain.local\SiteA\Data
  • DFS-R Pri: \\ServerA\Data\Subfolder1\Subfolder2\Subfolder3
  • DFS-R Sec: \\ServerB\DFSData\Subfolder3

The issue with DFS-N/R seems to be the need for the DFS-N path to match that of the DFS-R Pri replication path. When DFS-N path and DFS-R path are a miss math the DFS Client on the workstations does not locate the locally replicated files (even thouth they are in fact replicated to ServerB).

Hope this can help anyone in the future!

Good luck with you DFS project