• About Altaro
  • About Altaro VM Backup
  • 101 Free VMware Tools
  • facebook
  • twitter
  • google+
  • linkedin
  • rss
  • About Altaro
  • About Altaro VM Backup
  • 101 Free VMware Tools
Storage
Altaro.com » Altaro's VMware Hub and blog » Storage » How to add disk space to vCenter Server Appliance
Jason Fenech
by Jason Fenech in Storage, vSphere
Tags: vCSA, VCSA 6.5, VMware, vSphere 6.5
adding disk space to vcenter server applicance

How to add disk space to vCenter Server Appliance

11 Dec 2017 by Jason Fenech
1 Storage, vSphere
 

Eventually, you’ll run out of free space on one or more disks attached to your vCenter Server Appliance. You can always delete redundant logs, shrink databases and perform other general maintenance tasks. The best solution, however, would be to expand the VMDK that’s run out of space. Ok, great, but how do I do this? In today’s post, I’ll be showing you just that, how to expand a VMDK attached to a vCenter Server 6.0 or 6.5 appliance using shell commands.

If you’re still thinking about migrating from the vCenter Windows version to the appliance, a quick look at upgrading to vCSA 6.5 will, hopefully, help you decide if this latest release is something you’d want to go for.

 

Of Disks and such


By default, vCSA 6.0 is deployed with no less than 11 VMDKs or virtual disks. With vCSA 6.5, an additional 12th disk is used as a patch and update repository by Update Manager which, as you probably know by now, is part and parcel of vCenter Server Appliance.

The following table lists all the disks associated with a vCSA 6.x instance. The disks numbered 1 to 11, are common to both vCSA 6.0 and 6.5. The one difference is that vCSA 6.5 reserves disk 11 for the imagebuilder service whereas in vCSA 6.0 it’s used by the Inventory Service.

A list of disks created when vCSA 6.x is installed
A list of disks created when vCSA 6.x is installed

 

The next screenshot lists the 12 disks associated with a vCSA 6.5 instance in vSphere Web client. These can be listed by selecting Edit Settings from the VM’s context menu and clicking on Manage other disks to reveal the remaining disks since only the first 2 are shown.

No less than 12 virtual disks are used by vCenter Server Appliance 6.5
No less than 12 virtual disks are used by vCenter Server Appliance 6.5

 

Add disk space to vCenter via Bash


Adding space to a disk is done via the Web vSphere client in conjunction with vCSA’s shell or Bash commands. Let’s start with Bash first.

Note: You need to have SSH enabled for this to work. To enable SSH, you can use VAMI, DCUI, or the vSphere Web client.

Enabling SSH on vCSA from VAMI
Enabling SSH on vCSA from VAMI

 

vCSA 6.5

In this example, I’ve added 10GB to disk 12 on my vCSA 6.5. Disk 12 is used as a patch repository for vSphere Update Manager.

Step 1 – Resize the disk from the VM’s virtual hardware settings as shown. Locate the vCSA VM, right-click on it and select Edit Settings.

Resizing a disk in vSphere Web client
Resizing a disk in vSphere Web client

 

Step 2 – SSH as root on the appliance using putty or similar. Type shell or shell.set –enabled true at the prompt to enter BASH.

Establishing an SSH connection to vCSA and logging in as root
Establishing an SSH connection to vCSA and logging in as root

 

Step 3 – Run df -hl to display the current disk sizes and utilization. The disk we want to add space to is listed last as shown next.

Using the DF command to display disk space utilization in BASH
Using the DF command to display disk space utilization in BASH

 

Step 4 – Run the following script after you’re done setting the new size.

Shell
1
/usr/lib/applmgmt/support/scripts/autogrow.sh

The autogrow.sh script scans all the drives and resizes the ones it finds marked for expansion. You should see something similar to the output shown next.

A logical disk that has just been resized

 

Step 5 – Run df -hl once more to verify that the disk has been correctly resized. We can see that the disk is now 10GB larger in size.

Verifying that the disk has been resized
Verifying that the disk has been resized

 

vCSA 6.0

With 6.0, the large part of the steps is identical to the ones used to resize vCSA 6.5 disks. The only change is in step 4, where the command listed next is used instead of autogrow.sh.

Shell
1
vpxd_servicecfg storage lvm autogrow
In this example, I’ve added 5 GB to disks 5 and 6 which are respectively dedicated to storing the appliance’s logs and databases.

Resizing a disk from BASH on vCSA 6.0
Resizing a disk from BASH on vCSA 6.0

 

Note: This command works on vCSA 6.5 as well. However, it’s best to stick to using autogrow.sh as previously outlined.

 

Using Shell

The second method uses Shell commands. Note that this method only works for vCSA 6.5.

Step 1 – Resize the selected VMDK by editing the virtual hardware of the vCSA’s VM with vSphere Web client.

Step 2 – SSH to the appliance, logging in as root. Run the following command:

Shell
1
com.vmware.appliance.version1.resources.storage.stats.list

This is the equivalent to running df -h under BASH. The step while optional nevertheless provides some disk utilization info even though the output is not as user-friendly as it is with df -h.

Listing disk info from Shell
Listing disk info from Shell

 

Step 3 – Run the next shell command to expand the VMDK.

Shell
1
com.vmware.appliance.version1.system.storage.resize

Note: The command does not produce any output. To verify that the VMDK has been expanded, re-run the command from step 1. You can also change back to BASH and run df -h instead.

 

Conclusion


We’ve seen how using shell commands, any disk attached to a vCenter Server 6.x appliance can be resized. The operation is easy to carry out. First, resize the selected disk from the vCSA VM’s settings using the vSphere Web Client or otherwise. Then, SSH to the appliance and run the commands outlined in this post.

If you’re still running vCenter Server for Windows, have a look at How to install vCenter Server Appliance 6.5 from scratch and vCenter Server for Windows and vCSA compared. Though support will still be offered, vCenter Server for Windows is on its way out. In the long run, it pays to learn about vCSA and the new features it brings to the table.

Have any questions or feedback?

Leave a comment below!

Jason Fenech
Jason Fenech

An IT veteran for over 23 years, I covered various roles throughout my career. Prior to joining Altaro as a blog writer and QA tester, I was employed as an infrastructure engineer at a cloud services provider working exclusively with VMware products. The Altaro VMware blog enables me to share the experience and knowledge gained and, much to my surprise, is what got me the vExpert 2017 award. Besides being a techie and a science buff, I like to travel and play guitars. I also do some photography and love having a go at playing the occasional XBOX game, Halo being my absolute favourite. I am also a proud father of two and parent to a crazy Dachshund called Larry.

All Posts   WEBSITE   EMAIL

1 Comment on “How to add disk space to vCenter Server Appliance”

  1. Alex December 23, 2017 at 5:13 pm

    Great Jason.

    This is also a good reference for everyone out there:
    https://community.spiceworks.com/how_to/144372-clear-log-files-vcenter-server-appliance

    Clear the log files!

    Reply

Click here to cancel reply.

Have a question or comment? We'd love to hear it! Cancel reply

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

XHTML: You can use these tags <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

 

Featured product

Download Altaro VM Backup

Download 30-day trial or Free Edition (free for 2 VMs, forever.)

Site categories

  • vSphere
  • Storage
  • Automation and Management
  • Altaro News
  • Desktop Virtualization
  • HyperConvergence
  • Cloud
  • Uncategorized

Altaro Software

  • About Altaro
  • Altaro VM Backup

Altaro VM Backup

  • Altaro VM Backup
  • Download Free Version
  • Download 30-day Trial

Our writers

  • Jason Fenech Jason Fenech
    142 Posts
  • Andy Syrewicze (Chief Editor) Andy Syrewicze (Chief Editor)
    24 Posts
  • Ryan Birk
    22 Posts
  • Luke Orellana Luke Orellana
    18 Posts

Copyright © 2018 Altaro Software.

  • facebook
  • twitter
  • google+
  • linkedin
  • rss
[contact-form-7 id="4731" title="Act-On subs"]