Creating a RAMDisk in Server 2016 for IO Benchmarking
By Nick Taylor
Published March 16, 2017
Estimated Reading Time: 2 minutes

Hi Again everyone!  This post I’ll be showing some PowerShell commands for creating a RAMDisk.  Recently I was engaged at a client site where we were baking off Hyper-V vs VMware.  The Host and Network Stacks consisted of the same fabric but the storage back end were placed on different block level arrays with different specifications and running workloads so we needed a way to do an apples t.

We wanted our test results to have as few variables as possible so we decided to store our SQL dbs in a RAM Disk.  Follow the steps below if you ever have a need for it!



Here is the PowerShell for easy Copy/Paste

New-iscsiservertarget -TargetName “testramdisk”

Set-IscsiServerTarget -TargetName “testramdisk” -InitiatorId “IQN:*”

New-IscsiVirtualDisk –Path “ramdisk:test.vhdx” –Size 20MB

Add-iscsivirtualdisktargetmapping -targetname “testramdisk” -Path “ramdisk:test.vhdx”

First to Prepare your VM Make sure you have the iSCSI Target Server Role installed

Also make sure you have your local IP listed for the Target Portal under the iSCSI Initiator

Run the PowerShell Commands listed above

You should now see an Inactive iSCSI Target

Choose to Connect to this new target

Once you do you will see a new disk that is offline in Disk Management

Choose to Online the disk, Initialize the Disk, and Format the Disk with a drive letter.  You now have a functioning RAM Disk!

Post Tags:
Article By Nick Taylor
Consultant – Model Technology Solutions Nick is an IT professional with more than 19 years of experience and a passion for learning about technology. His areas of expertise include datacenter, hypervisors, storage, network, cloud, and OSD. He spends his free time delving in crypto, video games, automation, IoT, and really anything nerdy.

Related Posts