ESXi

 Datastore expansion problem

Reza Fathi's profile image
Reza Fathi posted Jun 13, 2024 12:00 PM

Hi

recently, I have expanded my QNAP raid by 2 TB hard. The Qnap is connected to my vmware esxi 8.0.2 with ISCSI. I tried to increase the capacity from web  gui but it showed an error "failed to expand vmfs datastore". I connected to webclient again in few hours and 2 TB were added to Qnap device in devices tab but it did not add to datastore as you can see in screen shots. I did rescan but without any success. any help would be appreciated. 

a_p_'s profile image
a_p_

ESXi offers a command to grow a VMFS datastore from the command line (see e.g. step 5 at https://knowledge.broadcom.com/external/article/321398/expanding-local-datastore-in-vsphere-esx.html).

CAUTION: Without knowing what may have caused the error, and whether there are some limitations QNAP and VMFS5 datastores, I strongly recommend that you have a current backup prior to running the command.

André

Reza Fathi's profile image
Reza Fathi

Hi

thanks. you mean I should start only from step 5?

a_p_'s profile image
a_p_

I mentioned the KB article just as an example for the command's syntax.
Since the device, and the partition have already been expanded (according to the screenshots), it's likely only the filesystem expansion which did not work.

André

Reza Fathi's profile image
Reza Fathi

I unmount and re-mount on windows and it showed the full storage but in esxi it shows the old storage. what exactly should i do?

a_p_'s profile image
a_p_

You mounted the LUN on Windows???
How did you verify the file system? Windows doesn't know VMFS by default.

Can you confirm that the datastore is sill usable on the ESXi host after that?

André

Reza Fathi's profile image
Reza Fathi

i just mount it. I did not format it

Kissan's profile image
Broadcom Employee Kissan

is the datastore working now or still with old size?

Reza Fathi's profile image
Reza Fathi

Still with old size.if you need more info from esxi , i can give you. Any idea???

Kissan's profile image
Broadcom Employee Kissan

ssh to host which can access affected datastore. 

list vmfs datastores

esxcli storage vmfs extent list 

copy device naa.xxx

get device disk info 

esxcfg-scsidevs -c |grep naa.xx (from previous command)

get device partition info 

example:

partedUtil getptbl vmfs/devices/disks/naa.60002ac000000000000000120002aca3

please print result for next step

Kissan's profile image
Broadcom Employee Kissan

ssh to esxi host which can see affected datastore. 

list vmfs volumes 

esxcli storage vmfs extent list 

here copy affected device naa.xx 

then get device disk details 

esxcfg-scsidevs -c |grep naa.xx (from above command)

then get device partition info 

example: 

partedUtil getptbl vmfs/devices/disks/naa.60002ac000000000000000120002aca3

then get device backend size 

partedUtil getUsableSectors vmfs/devices/disks/naa.60002ac000000000000000120002aca3

print result for next step

Reza Fathi's profile image
Reza Fathi

Here is the screenshots from all steps:   *****this command : 

esxcli storage vmfs extent list  did not work.****

Kissan's profile image
Broadcom Employee Kissan

device partition is already expanded, can you access the datastore and see data content. 

is datastore still showing old size on host & vcenter? 

do

df -h |grep datastore-name

Reza Fathi's profile image
Reza Fathi

yes I can access the datastore content. But it still shows an old size.

Kissan's profile image
Broadcom Employee Kissan

Ok then perform growfs 

command: 

example: 

vmkfstools --growfs /vmfs/devices/disks/naa.6090a0d800c7b290a85395d1bd04f05b:1 /vmfs/devices/disks/naa.6090a0d800c7b290a85395d1bd04f05b:1
Once completed. 
run vmkfstools -V 
then perform storage rescan in host and vcenter, it should show datastore updated size 
Reza Fathi's profile image
Reza Fathi

on which one should I use this command?

Kissan's profile image
Broadcom Employee Kissan

use actual device ending 88fd5:1

Reza Fathi's profile image
Reza Fathi

I shows this error:

Kissan's profile image
Broadcom Employee Kissan

try it again and put device in quote 

example: 

vmkfstools --growfs "/vmfs/devices/disks/Device:partition" "/vmfs/devices/disks/Device:partition"

Reza Fathi's profile image
Reza Fathi

I tried with quote but no success.

Reza Fathi's profile image
Reza Fathi
Kissan's profile image
Broadcom Employee Kissan

ok redo the steps again 

command: 

partedUtil resize /vmfs/devices/disks/naa.6e843b6741d400cdc341d4575db88fd5 1 2048 19092471774

then growfs again 

vmkfstools --growfs /vmfs/devices/disks/naa.6e843b6741d400cdc341d4575db88fd5:1 /vmfs/devices/disks/naa.6e843b6741d400cdc341d4575db88fd5:1

once completed 

vmkfstools -V 

then check datastore size 

df -h |grep QNAP-NAS

Reza Fathi's profile image
Reza Fathi

Thanks. Is this commands safe? Because i have VMs running on this datastore and this datastore is shared between 2 other esxi servers

Kissan's profile image
Broadcom Employee Kissan

The previous commands has been pulled from device partition getUsableSectors. 

Here definitely if you are not comfortable or concerned, then better take backup of running production vms before performing task. 

Alternatively, please consider migrating vms off affected datastore to another datastore. 

once completed then you can just unmount and delete affected datastore and create a brand new datastore with new size rather than going through the datastore expansion steps again. 

Reza Fathi's profile image
Reza Fathi

Hi

I did the commands you told me but it did not work.

Reza Fathi's profile image
Reza Fathi

Hi

I did you last commands but without success.

PaulB2's profile image
PaulB2

I see this is an old vmfs5 datastore which is obsolete. If the version of esxi you are on supports it, create a new vmfs6 datastore and migrate your VMs over and delete the old datastore.