Updating Disk Properties in VMware

Virtual disks attached to a SoftNAS instance in a VMware environment are all deemed one type regardless of which type the backing DataStore is whether its SSD, HDD, NFS, etc. From the point of view of SoftNAS, they are all VMware Virtual Disk.

In contrast with AWS and Azure where you can be able to edit the disk type and properties once it is provisioned via their respective web consoles, in VMware you can't change it easily. You may have to migrate the virtual machine and/or the virtual disks to a DataStore with the desired performance characteristics.

 

In this guide, we will cover updating the VMware Virtual Disk’s size as that is supported on the fly by editing Virtual Machine’s disk settings.

Warning: Before proceeding, ensure that you have appropriate permissions to modify Virtual Machine and it’s attached Virtual Disks, and make sure to backup critical data to avoid data loss during the process.


 

When using SoftNAS, you can add VMware Virtual Disks and attach them to the instance and create a Storage pool out of them. Storage pools are used to aggregate disk storage into a large pool of storage that can be conveniently allocated and shared by volumes.

Warning: To achieve optimal performance of a Storage Pool, SoftNAS recommends the use of disks of same types, sizes and performance characteristics. In existing Storage pools with varying disk types and sizes, SoftNAS recommends updating all the disk types to same type and performance characteristics and updating the disk sizes to a value greater than or equal to the largest disk size used by the pool. Some if not all of these configurations can be updated by changing the disk size, and the type of DataStore backing the virtual disk.

Here's a step-by-step guide on how to do this:

In this guide, we are using screenshots from VMware vCenter 8 web client. Steps for using other clients may vary with the steps documented in here but the idea of updating the disk size and datastore type are the same in all clients.

Part 1: Updating Virtual Machine’s Virtual Disk size

1. Login to vCenter 8 Web Client

Open a web browser and log in to your vCenter Server using the web client. Make sure you have the necessary permissions to modify VM settings.

2. Locate the Virtual Machine

In the vSphere Client, navigate to the VM you want to modify by selecting the appropriate datacenter, cluster, or folder in the left-hand inventory panel and then selecting the VM from the list of VMs.

3. Edit Virtual Machine Settings

Right-click on the VM you want to modify and select "Edit Settings" from the context menu. Alternatively, you can select the VM and click the "Actions" button at the top right and it will show the same context menu where you can select “Edit Settings”.

4. Update Virtual Disk Size

In the "Edit Settings" dialog box, select the virtual disk you want to change.

5. Review and Confirm

Review the changes you've made in the "Edit Settings" dialog to ensure they are correct. Click "OK" to apply the changes.

6. Power-On the VM and Verify

If the VM was powered off, you can now power it on. After the VM is powered on, ensure that everything is functioning as expected and that the virtual disk is now expanded to new larger size.

7. Update File System

If you are resizing/expanding the VM’s virtual disks, you may need to expand the filesystem using appropriate commands for your system.

7.1 Expand the Storage Pool Quota

If you are resizing/expanding the virtual disk which is part of an existing SoftNAS Storage Pool, you need to expand the Storage Pool’s size and set new quota to 80% of the new Storage Pool’s size.

Here are the steps on how to update the Storage Pool’s quota:

7.1.1 Expand the device to use all available space

Expand the device to use all available space. If the device is part of a mirror or raidz then all devices must be expanded before the new space will become available to the Storage pool. Execute the command zpool online -e <pool name> <device name> as below:

Before expanding the device used by the pool, lets examine first the pool’s current size

root@SoftNAS:~# zpool get -p size nas_pool # get the pool's current size NAME PROPERTY VALUE SOURCE nas_pool size 102005473280 - # size is around 95GB

as you can see, the pool’s current size is still 95GB which is the usable space of the pool composed of disks of sizes 64GB and 32GB.

Now, we can expand the device used by the pool as below:

root@SoftNAS:~# zpool online -e nas_pool sdb # expand the pool's disk root@SoftNAS:~# echo $? # check if command is successfull 0 root@SoftNAS:~# zpool get -p size nas_pool # check pool's new size NAME PROPERTY VALUE SOURCE nas_pool size 136365211648 - # size is now around 127GB root@SoftNAS:~#

Get 80% of the pool’s new size and set it as the pool’s new quota.

# new_quota = 127GB * 0.80 = 101.6GB root@SoftNAS:~# zfs set quota=101.6G nas_pool # set pool's new quota root@SoftNAS:~# zfs get quota nas_pool # get pool's new quota NAME PROPERTY VALUE SOURCE nas_pool quota 102G local # 102GB is the new quota rounding up 101.6GB root@SoftNAS:~#

Part 2: Moving Virtual Machine to a new DataStore

Moving a virtual machine (VM) in vCenter 8 to a new datastore involves several steps to ensure a smooth and successful migration. Here's an outline of the steps:

1. Login to vCenter 8 Web Client

Open a web browser and log in to your vCenter Server using the vSphere Web Client. Please see Step 1 of Part 1 above.

2. Locate the Virtual Machine

In the vSphere Client, navigate to the VM you want to migrate by selecting the appropriate datacenter, cluster, or folder in the left-hand inventory panel and then selecting the VM from the list of VMs. Please see Step 2 of Part 1 above.

3. Shutdown VM

4. Migrate VM

Right-click on the VM you want to move and select "Migrate" from the context menu.

5. Select Migration Type

Choose the migration type. For simplicity, we will choose “Change storage only” migration type.

6. Select Destination Storage

In the migration wizard, select the destination datastore where you want to move the VM. In this case, we are migrating our VM to an SSD-backed datastore which is probably faster than other datastores available.

7. Review and Confirm

Review the migration settings and make sure they are correct. Click "Next" or "Finish" to start the migration process.

8. Monitor the Progress

Monitor the migration progress. Depending on the VM's size and the available resources, this process can take some time.

9. Verify VM Functionality

After the migration is complete, power on the VM and verify that it functions as expected.

10. Clean Up

Once you've confirmed that the VM is working correctly on the new datastore, you can delete any snapshots or backups created before the migration, if applicable.

11. Documentation and Testing

Update any documentation to reflect the VM's new location and perform testing to ensure it's working correctly.

12. DataStore Maintenance (Optional)

If you've migrated all the VMs from the old datastore, you can decommission or repurpose the old datastore as needed.

13. Monitor and Test

After the modification is complete, monitor your system's performance to ensure it meets your expectations.