Hyper-V

Add Local Storage in Windows Server 2016 Hyper-V

To Add local storage in Windows Server 2016 Hyper-V can be easily accomplished with the diskpart utility to bring the storage online for use

One of the tasks you may need to accomplish when working with a Windows Server 2016 Hyper-V host is adding local storage to the host. ย Often, VMs will be housed on a volume that is separate from the operating system volume that contains Windows Server 2016. ย Let’s take a quick look at how to add local storage in Windows Server 2016 Hyper-V. ย If you have installed the Server Core install using the Windows Server 2016 Standard or Datacenter edition, or if you have installed the free Hyper-V Server 2016, we will be accomplishing this from the commandline.

Add Local Storage in Windows Server 2016 Hyper-V

To bring a new storage volume online in Windows Server 2016 Hyper-V, we can use theย diskpart utility which is the commandline tool that allows us to manipulate storage in Windows Server. ย The following is a sample of the diskpart commands you would use to bring an extra volume online.

DISKPART> list disk
DISKPART> select disk <disk number>
DISKPART> online disk
DISKPART> attributes disk clear readonly
DISKPART> clean
DISKPART> convert gpt
DISKPART> create partition primary
DISKPART> select volume <volume number>
DISKPART> format fs=refs label=VMs quick
DISKPART> assign letter d
DISKPART> list volume

The above commands are straightforward. ย However, just a quick walk through here. ย We begin by listing out the available disks on the server. ย We select the disk that we want to use as Hyper-V storage, bring it online, clean it, and then convert it to a GPT disk. ย Then we create a partition, format it, and finally assign it a drive letter. ย You can then list the volumes and should be able to see the newly created ReFS volume online with the appropriate drive letter.

hypervdisk02

Also, in listing the volume we can see that we have our volume online and ready, formatted, and we have a drive letter assigned to the volume. We should now be able to configure this volume in Hyper-V settings to store the VM disks as well as the configuration files.

Attach using Disk Management MMC Console

Remote management on the Hyper-V host still requires that we put any firewall rules in place to allow connecting to the server. If we want to use a remote Disk Management Console session to manage the storage on our Hyper-V host, we need to add a firewall exception both on the server AND the workstation side.

netsh advfirewall firewall set rule group="Remote Volume Management" new enable=yes

Once the firewall rule is in place, you can use the disk management console to connect to the remote Hyper-V server.hypervdisk03

Thoughts

Using diskpart to add local storage in Windows Server 2016 Hyper-V is an easy way to effectively add a volume to the Windows Server 2016 Server core install or the Hyper-V Server 2016 which is essentially Server Core with the Hyper-V role already installed. Both are GUI’less so we must use the commandline tools to manage the server from the console.

Subscribe to VirtualizationHowto via Email ๐Ÿ””

Enter your email address to subscribe to this blog and receive notifications of new posts by email.



Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com, and a 7-time VMware vExpert, with over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, He has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family. Also, he goes through the effort of testing and troubleshooting issues, so you don't have to.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.