locked
Create New Virtual Machine with Fixed virtual disk RRS feed

  • Question

  • Hi

    Why can't I use New-VM to create fixed size VHD with new machine. New-VM create dynamic VHD by default but no option to create fixed size VHD simultaneously.

    Everybody says that virtuals servers it shloud use fixed size VHD, but the basic powershell command New-VM doesn't get that opportunity. Or am I wrong?


    Kind Regards Tomasz


    • Edited by Yukio Seki Friday, May 13, 2016 1:33 PM bug
    Friday, May 13, 2016 1:31 PM

Answers

All replies

  • Everybody says that virtuals servers it shloud use fixed size VHD, but the basic powershell command New-VM doesn't get that opportunity. Or am I wrong?


    Kind Regards Tomasz


    Who says that? I never create fixed size VHD for systems that can use them.

    \_(ツ)_/

    Friday, May 13, 2016 3:35 PM
  • New-VHD -Path c:\temp\disk1.vhd -size 30Gb -Fixed

    Try to learn how to use PowerShell help.  It will save you a lot of complaining and pain.

    HELP New-VHD -Full

    help help


    \_(ツ)_/

    Friday, May 13, 2016 3:38 PM
  • Hi...

    I joined some web seminaries about Hyper-V, and everybody talked you should use Fixed disk for servers. More applications prefer fixed disk (MS SQL,...) not dynamic disk. For VM with Windows 8,10 you can use it dynamic disks...

    New-VHD ... i know it...and use it. But first you have create disk, then create VM and then add disk to VM. Three steps for VM with fixed disk (New-VHD, New-VM, Add-...) - one step for VM with dynamic disk... (New-VM):(

    Thank you for your replay.

    Have a nice day!


    Kind Regards Tomasz

    Saturday, May 14, 2016 9:23 AM
  • I think you are getting only half of the answer.  Yes. A SQL Server that increases its data file size often may seem happier on a fixed size disk but yu can tune the disk expansion to account for that,  Again, it all depends on what you are designing. 

    A fixed disk can be created in one step as I have posted above.  You need to spend some time reading the instructions for the CmdLets.  The information is extensive and there are many examples in most help files.

    For SQLServer I would place the data files on a second VHD fixed or dynamic so the interaction with the system drive is minimized. This will eliminate one common bottleneck.

    The system drive can easily be dynamic and probably should be to prevfent future issues.  SQLServer data should be relocated to its own disk.  With a VM all of this is easy where on a physical machine we may not actually have a physical drive and parttining a drive only kills performance. 

    Since my first days with building databases on minicomputer hardware the relocation of the data to multiple drives has been a main method of optimization. With VMs this can be a best approach since we can have as many VHDs as we like and move the around as needed.


    \_(ツ)_/


    • Edited by jrv Saturday, May 14, 2016 10:49 AM
    Saturday, May 14, 2016 10:43 AM
  • Here is a good starting explanation of how to build a disk for SQLServer in Hyper-V.  It covers both Fixed and Dynamic setups and explains why the issue is mostly related to where you create the VHDX.  Pay attention to the discussions on block size.

    http://www.michaelsteineke.com/post/2014/07/09/Block-Size-and-Performance-with-Hyper-V-and-SQL-Server.aspx


    \_(ツ)_/

    • Proposed as answer by Elaine Jing Monday, May 16, 2016 7:39 AM
    • Marked as answer by Elaine Jing Friday, May 20, 2016 8:30 AM
    Saturday, May 14, 2016 10:57 AM