I’m running WSUS on a 2012R2 server and the drive where the updates are tends to grow a lot. On this VM, I increased the provisioned size of the c:\ drive and not the drive where the updates reside. I didn’t notice I’d touched the wrong disk until I’d rescanned the disks on the VM and saw what I’d done.
As panic set in, I changed the provisioned size back to 60GB (I know, I know) and well, you know the rest. This article saved me today. I didn’t want to restore the VM unless I really had no choice, this did the trick.
Power off the VM and identify the host & datastore that the VM resided on, I enabled SSH and browsed to the VM location.
Cat out the descriptor file (vmname.vmdk) that outlines the data layout on the virtual disk. In the Extend Description section, you’ll see the extent(s) info. Next to RW (if it’s read/write) a number. That number represents the size of the vmdk in sectors, with the additional 200GB included.
To change the sector size to reflect the value I’m shrinking the drive back down to, 60GB, calculate it:
60GB = 60 * 1024 * 1024 * 1024 / 512 = 125829120 sectors
Edit the descriptor file and change the sectors to the new number, save and exit.
Come out of the directory where the VM resides and VMotion it to another datastore. Review the settings of the vm and take note of the new and improved disk size.
Power on the VM and review the size in Disk Management.
Now, grow the right disk and try not to ever do that again.
We’ve all been there, running a server that’s way past it’s prime on 6 year old hardware. The application grows, the size on the partitions shrink. Then one day, you get the call and things aren’t working ‘right’ because there is no space. You suggest P2V or reinstalling the application on a VM. You’re met with stares, grumbles of “I’m too busy” and looks of utter discontent.
The only thing to do is add more disks and grow the drives in question.
How to add drives to a vDisk on a PERC 5/i integrated controller
(disclaimer! These are the steps I took, they may not work for you in your environment)
- Before performing any hard disk reconfigurations, please make sure you have a good (tested) backup of your server. As with all HD reconfigurations, there is a risk of data loss.
- Confirm the Dell Open Manage Server Administrator is installed. If not, download and install it.
- Add the hard drives to the server and reboot. They should be the same size or larger.
- Boot to the PERC (raid controller) in the bios. On the Dell PowerEdge it’s CTRL+R
- There is an additional menu that now appears up top called Foreign View. CTRL+N over to the Foreign View menu and view the additional disk group. You’ll see it’s marked as foreign.
- Highlight the Controller where the foreign configuration exists, press F2 . Use the arrow keys expand the menu with the arrow keys and select clear. Clear will delete the foreign configuration (example, if you’re using disks from another server). Press Enter.
- Press OK if you’re sure you want to clear the configuration.
- Press OK. You’ll see that the foreign view menu has disappeared.
- Exit the BIOS utility by pressing ESC. Reboot the server.
- Log into the server and launch Server Administrator. Expand the Connector and the physical disks. The state of the disks should read “Ready” and the used RAID disk space as 0GB.
- From the left pane, click on the virtual disk and click the down arrow next to Available Tasks. Select Reconfigure and click execute.
- Click the connector to view the physical disks. Select the disks that you just installed by clicking the check box.
- The new disks are now listed under selected physical disks. Click continue.
- Select the current raid level of the current disks. If your virtual disk is currently RAID-5, make sure you select RAID-5. Click continue.
- Review the new virtual disk configuration. Click finish.
- The disk reconstruction will begin and the progress will be displayed.
- This will take several hours to complete. Once finished, view disk management. There you can see the new unallocated space at the end of the disk.
- To grow C:\ the free space must be immediately following that partition. Use disk part to move the partitions around (steps to follow). First, you can grow D:\ by using diskpart.
Continue on to Step 2
To Grow the D:\ Drive
This is part 2 of the “Adding space to a vDisk on a PERC 5/i Controller” post.
Back to Part 1
- Launch diskpart from the command prompt. #diskpart (enter)
- It opens in another window. Enter #LIST DISK (enter) and review the disks of the server.
- Enter #LIST VOLUME (enter) to view the volumes. Note the volume numbers next to the drive letter. You will select the volume that you would like to grow.
- #LIST PARTITION (to view the partitions)
- Enter #SELECT DISK # (the number of the volume you’re growing). This is to bring focus on the disk that you’re working with. OR
- Enter #SELECT VOLUME 2 (the D:\ is what we’re growing so we will have enough space to ‘give’ to C:\)
- Decide on the size that you’d like to grow the disk by (in MB). In this example, we grew the disk by 100GB. Enter #EXTEND SIZE=100000 (100GB~)
- You’ll see the success message immediately following.
- Enter #LIST VOLUME (to review the size of the new volume. It will have an asterisk beside it)
- Enter #LIST DISK to view the available space on the vDisk.
- Enter #EXIT to close diskpart.
- Go back to disk management and view the size change of D:\ and the unallocated space.
Next Step: Growing the C:\ Drive