3 Replies Latest reply on Nov 12, 2017 3:50 AM by ps1code

    Expand VM Disk

    danielmgrinnell Enthusiast

      Hey all,


      I am working on automating Expanding a VM disk and the Datastore it lives on.


      Now here is my logical process,


      Expand Volume in SAN (Dell Compellent) (currently done manually)

      Expand Datastore with newly configured space from LUN

      Expand VM Hard Disk ( this is done and automate, but am always up for suggestions!)

      Expand Guest OS w/ Invoke-VMScript and DiskPart , but again am always up for suggestions


      I thought i would throw this out there while im currently working on this and see what the community thinks.


      Thanks all!!

        • 1. Re: Expand VM Disk
          LucD Guru
          User ModeratorsvExpertCommunity Warriors

          Do you only have Windows-based guest OS on your VMs?


          The order of your actions is ok, and how I should do it.

          Perhaps action 1 and 2 could be avoided if there is enough free space on the datastore

          • 2. Re: Expand VM Disk
            danielmgrinnell Enthusiast

            Hey lucd,


            Yes on Windows so that makes functionaly less work I suppose considering we only have to tackle one os.


            on the “datastore” / volume expansion we run one vm for one datastore which is another discussion entirely haha, but I think justifies my requirements for the expand volume, potentials build in a host rescan, pause, and expand new space on datastore.


            If we had multiple vms per ds that would eliminate the need for touching the ds as often Thats for sure, but we’re are doing array based replication in some instances and that’s why we have that.



            • 3. Re: Expand VM Disk
              ps1code Lurker

              I would split this task to three functions/blocks:

              1. SAN related function (vendor specific);

              2. Datastore function;

              3. VM+VM Guest function. You can use my Get-VMGuestPartition/Expand-VMGuestPartition functions.

              Roman Gelman @ps1code