When we try to upgrade vCenter Appliance if we have much data to migrate from one version to another (this is from 6.5 to 6.7 or 7.0), we need to have enough space in the root partition in the source vCenter Appliance (bear in mind that the upgrade will create a new VCSA VM). If there is no space, we get an error in the upgrade.
In this How to add extra space to vCenter for the upgrade, I will explain how to add extra space to your vCenter Appliance before you start the upgrade.
This is a procedure that needs to be done before you start your upgrade.
This an example of what type of data will be migrated from the source vCenter.
As we can see in the above image, we will need a space of at least 8Gb in the root / vCenter partition for the upgrade and is used as a temporary folder for the data migration. And in this case, the space available is only 4.2Gb.
Login to your vCenter console and check the space.
If we continue with the migration, we will get an error almost when it is finishing the upgrade.
I had this many times, so I have many examples and screenshots that I took from several upgrades that I have done.
How to add extra space to vCenter for the upgrade?
“Edit Update 20/06/2020
There were some comments from readers (in this blog post and also in some vExpert groups) regarding the options to extend a root partition in vCenter Appliance 6.5. So I decided to add some extra information so that it is clear what are the alternatives to extend the root partition, and also what other options we could have to bypass the vCenter upgrade lack of space.
So I will propose different options, and not just adding an NFS Shared Folder.”
The vCenter Appliance version that I am trying to upgrade is the latest: VMware vCenter Server Appliance 184.108.40.206400 Build Number 16275158 – 28/05/2020.
- First option: Use a different partition for the temp files.
Note: This option I could had proposed when I wrote the blog post, but honestly, I forgot. Even I had some screenshots of some examples I did some time ago.
Check your Appliances partitions space.
In the above example is possible to check that partition /storage/updatemgr/ for vCenter updates (or VUM) has enough space for the temporary migrations files.
The best option here is to create a temp folder inside the partition and use it for the migration files.
root@vcenter-65 [ / ]# cd /storage/updatemgr/
root@vcenter-65 [ /storage/updatemgr ]# mkdir UpgradevCSA
root@vcenter-65 [ /storage/updatemgr ]# ls -lh
drwxr-xr-x 10 updatemgr updatemgr 4.0K Jun 20 16:06 jetty-temp
drwx------ 2 root root 16K Mar 15 2018 lost+found
drwxr-xr-x 6 updatemgr updatemgr 4.0K Dec 4 2019 patch-store
drwxr-xr-x 2 updatemgr updatemgr 4.0K Dec 4 2019 patch-store-temp
drwxr-xr-x 2 root root 4.0K Jun 20 16:25 UpgradevCSA
- Second option:
In our Storage system or file server, whatever you are using to provide space, create an NFS shared folder with enough space to store the temporary files and mount in the vCenter.
After you create an NFS shared folder, login to vCenter and mount the shared folder in vCenter.
root@vCenter-01 [ ~ ]# mkdir /mnt/share/vCenterUpgrade
root@vCenter-01 [ ~ ]# mount.cifs //192.168.1.252/vCenterUpgrade/ /mnt/share/vCenterUpgrade Password for root@//192.168.1.252/vCenterUpgrade/: ********
root@vCenter-01 [ ~ ]# cd /mnt/share/vCenterUpgrade
root@vCenter-01 [ /mnt/share/vCenterUpgrade ]# dd if=/dev/zero of=file_name.txt bs=1MB count=1
1+0 records in
1+0 records out
1000000 bytes (1.0 MB, 977 KiB) copied, 0.0108669 s, 92.0 MB/s
root@vCenter-01 [ /mnt/share/vCenterUpgrade ]# ls -l
rwxr-xr-x 1 root root 1000000 Mar 7 15:07 file_name.txt
dr-xr-xr-x 2 root root 0 Mar 7 2020 @Recently-Snapshot
drwxr-xr-x 2 root root 0 Mar 7 2020 @Recycle
root@vCenter-01 [ /mnt/share/vCenterUpgrade ]#
In the above commands, I also included the command dd if=/dev/zero of=file_name.txt bs=1MB count=1 to make sure that vCenter can write in the shared folder, if not upgrade will again break.
Note: Don’t forget to create the NSF Share with proper permissions and use user/pass to mount in your vCenter.
In the upgrade process in the step to select the type of data to migrate, select your option and then select Export Directory and add the share folder that you just mounted.
Note: The need to mount an NFS Shared folder for your upgrade is for upgrades from vCenter Appliance 6.5/6.7 or to 7.0. The process and steps are the same. If you are upgrading from a Windows vCenter, if you don’t have space, you need to add extra space to your Windows vCenter disks.
- Third option:
Expand the root partition or even a different partition to use for the migration files.
Edit your vCenter Appliance VM and change the size of the disk/partition you need to expand.
This is the list of disks, and wich partitions belong to.
You can also use the command df -h; lsblk; lsscsi to check SCSI ID then trace which SCSI ID will show in the VM edit settings. But it is better and easier to follow the above table.
Again check your partitions and select the one you need to extend and change in the VM settings. For this case, I will expand the root partition ‘/’ that is VMK1 disk.
Note: Do not forget if the VM has any snapshots is not possible to edit the disk size. You need to remove any existing snapshots to be able to change the disk size in the settings.
After you run the VMware script that is inside of vCenter Appliance for extending the space of the LVM partition: /usr/lib/applmgmt/support/scripts/autogrow.sh
After running the command, just double-check partitions, and you should see a new size on the partition you just resized.
Note: The resizing of any partition in vCenter Appliance 6.7 or 7.0 can be done online. No need to reboot or power off the vCenter so that the resize takes place. So you can do this task and go back to the upgrade process and continue without the need to cancel or restart the upgrade process.
First and Second is for upgrades from 6.5 to 6.7 or 7.0. Works with all versions. The Third option is only supported for 6.7 and 7.0. Since extending root partition is not supported in 6.5 as we can check in the Release Notes.
After you modify the virtual machine configuration of the vCenter Server Аppliance to provide a larger disk space for expanding the root partition, an attempt to claim that additional storage fails
After resizing the disk space for the root partitioning, the
storage.resizecommand does not extend the disk storage for the root partition but keeps it the same size. This is an expected behavior. Resizing this partition is not supported.
There are some workarounds for expanding the root partition when using vCenter Appliance 6.5 . But besides is not supported, why spend time and work to do this when we have better alternatives. And also why spending time resizing the root partition when in the end the vCenter Appliance will be deleted and a new one is created?
Also when using the First and Second option, you do not need to reboot, or cancel your Upgrade process, just do the tasks when you get the warning about lack of space for the migration, and go back to the upgrade process and continue without the need to cancel.
The Third option for vCenter Appliance 6.7 or 7.0 can also be done online without the need to power to reboot or cancel the upgrade process.
Other articles in the VMware upgrades series:
- How to upgrade vCenter Appliance 6.5 to 6.7 and fix upgrade errors
- How to upgrade vCenter Appliance 6.7 to 7.0 and fix upgrade errors
- How to upgrade vSphere 6.x Clusters to vSphere 7
- How to upgrade NSX-T 2.4.x or 2.5.x to NSX-T 3.0
- How to upgrade NSX to vSphere 7.0
Note: I Will update the links to the above articles while I will write them.
I hope this information was useful.
Share this article if you think it is worth sharing. If you have any questions or comments, comment here or contact me on Twitter.