Hello,
I started setting up a ESXi 5.5 Update 1 server this week. I didn't realize that Dell shipped the server with two Virtual Disks instead of one. I realized this _after_ I had already created the datastore and setup a few VMs within. I called Dell which sent me specific instructions to increase the delete the second (blank) virtual disk and add it to the main one. In the end, I have increased the single VD from 2TB to 3TB and I want to give the remaining space to my datastore.
I tried to follow the KB article here which explains how to do this via CLI.
Well, it didn't quite work. Fortunately, I was able to recover my datastore my setting the start and end sectors back to their original numbers. But I'm still left with this nearly 1TB of space that I can't assign to the datastore. After I rescanned storage adapters in the client, the new Dell drive size was reflected under Extent Devices. Clicking "Increase..." produces the following error which led me down the path of the CLI method:
Call "HostDatastoreSystem.QueryAvailableDisksForVmfs" for object "ha-datastoresystem" on ESXi "[myservername]" failed.
I am going to paste my notes that I took while doing to job. Things went off the rails when I set the size of partition 4 to the larger size. Any help, please?
---
I am using this as a guide:
http://kb.vmware.com/selfservice/search.do?cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=2002461
1. Use the boot device hardware's management tools to add additional disk capacity to the device. For more information, engage your hardware vendor.
This has been done. The new size of the Virtual Disk is 2791.88 GB (2.79188 TB)
2. Open a console to the ESXi host.
Simple enough.
3. Obtain the device identifier for the Datastore to be modified.
~ # vmkfstools -P "/vmfs/volumes/datastore1/"
VMFS-5.60 file system spanning 1 partitions.
File system label (if any): datastore1
Mode: public
Capacity 1971926859776 (1880576 file blocks * 1048576), 1042688245760 (994385 blocks) avail, max file size 69201586814976
UUID: 534e5121-260d4450-19dc-f8bc1238e18a
Partitions spanned (on "lvm"):
naa.6c81f660ef0d23001ad809071096d28a:4
A couple of things to note:
a. The Device Identifier for Datastore1 is: naa.6c81f660ef0d23001ad809071096d28a
b. The Partition Number on the disk is: 4 "[...]:4"
c. The prefix, "naa," stands for "Network Addressing Authority" The number immediately after is a unique LUN.
4. Record the amount of free disk space on the Datastore.
~ # df -h
Filesystem Size Used Available Use% Mounted on
VMFS-5 1.8T 865.4G 971.1G 47% /vmfs/volumes/datastore1
5. Equipped with the device identifier, identify the existing partitions on the device using the partedUtil command.
~ # partedUtil get "/vmfs/devices/disks/naa.6c81f660ef0d23001ad809071096d28a"
364456 255 63 5854986240
1 63 80324 222 0
2 80325 8466884 6 0
3 8466885 13709764 252 0
4 13711360 3865468766 251 0
~ #
According to the chart on the KB article
4 13711360 3865468766 251 0 - Primary #4, Type 251=0xFB=VMFS, Sectors 13711360-3865468766
| | | | |
| | | | \--- attribute
| | | \------- type
| | \---------------- ending sector
| \------------------------- starting sector
\--------------------------- partition number
Also, notice how the starting section number is +1 from the previous ending sector number.
6. Identify the partitions which need to be resized, and the size of the space to be used.
We want to resize partition 4. I don't really understand the last part of this sentence, however. Read on.
7. Identify the desired ending sector number for the target VMFS Datastore's partitions. To use all space out to the end of the disk, subtract 1 from the disk size in sectors as reported in step 5 to obtain the last usable sector.
ESXi 5.x has a command for this:
~ # partedUtil getUsableSectors "/vmfs/devices/disks/naa.6c81f660ef0d23001ad809071096d28a"
1 5854986239
This means we want Partition 4 of "naa.6c81f660ef0d23001ad809071096d28a" to be:
13711360 - 5854986239 (i.e. the end of the disk)
8. Resize the partition containing the target VMFS Datastore using the partedUtil command, specifying the existing starting sector of the partition and the desired ending sector:
Using the above information, our command is:
# partedUtil resize "/vmfs/devices/disks/naa.6c81f660ef0d23001ad809071096d28a" 4 13711360 5854986239
9. During step 8, the partedUtil command may report the warning:
It did not. Moving on.
10. The partition tables have been adjusted, but the VMFS Datastore within the partition is still the same size. There is now empty space within the partition in which the VMFS Datastore can be grown.
11. Run this command vmkfstools -V to perform a refresh of the VMFS volumes.
Done.
12. Grow the VMFS Datastore in to the new space using the vmkfstools --growfs command, specifying the partition containing the target VMFS Datastore twice.
vmkfstools --growfs "/vmfs/devices/disks/naa.6c81f660ef0d23001ad809071096d28a:4" "/vmfs/devices/disks/naa.6c81f660ef0d23001ad809071096d28a:4"
This did not work. I got an error:
/vmfs/volumes # vmkfstools --growfs "/vmfs/devices/disks/naa.6c81f660ef0d23001ad809071096d28a:4" "/vmfs/devices/disks/naa.6c81f660ef0d
23001ad809071096d28a:4"
Failed to get info from head device path /dev/disks/naa.6c81f660ef0d23001ad809071096d28a:4
Also the partition was vastly different from what I asked for:
~ # partedUtil get "/vmfs/devices/disks/naa.6c81f660ef0d23001ad809071096d28a"
364456 255 63 5854986240
1 63 80324 222 0
2 80325 8466884 6 0
3 8466885 13709764 252 0
4 13711360 1560018942 251 0
I fixed it by running these commands:
~ # partedUtil resize "/vmfs/devices/disks/naa.6c81f660ef0d23001ad809071096d28a" 4 13711360 3865468766
~ # vmkfstools -V
~ # partedUtil get "/vmfs/devices/disks/naa.6c81f660ef0d23001ad809071096d28a"
364456 255 63 5854986240
1 63 80324 222 0
2 80325 8466884 6 0
3 8466885 13709764 252 0
4 13711360 3865468766 251 0