VMware Cloud Community
hurdle
Enthusiast
Enthusiast
Jump to solution

Help creating partition via CLI

We recently upgraded our environment from 4 to 5

Since then I have been frustrated and not having success creating new VMFS 5 datastores via CLI

I am absolutely pulling out my hair trying to use the partedUtil, an someone please let me an easier way

I am in the VMA because once I am ready to use vmkfstools I will need to be in their anyways

Based on document  VMware KB: Using the partedUtil command line utility on ESXi and ESX  

first it says run ls /vmfs/devices/disks/

I try from the VMA and it telss me no Such file or directory so then I go to the host itself

to get mpx names which I don't I only see naa

Then it says to do partedUtil setptbl "/vmfs/devices/disks/mpx.vmhba0:C0:T0:L0"

Which I can't because the above name I only saw the naa

And what the heck is up with the big older number and the end of the

gpt "1 128 500000 AA31E02A400F11DB9590000C2911D1B8 128" "2 500001 999999

AA31E02A400F11DB9590000C2911D1B8 0"

Does that actually have to be in there.

At the end of the day I just want the steps involved is preparing the partition so I can format it with vmkfstools.

Please help, I am finding the articles very confusing

0 Kudos
1 Solution

Accepted Solutions
hurdle
Enthusiast
Enthusiast
Jump to solution


Never mind its C*h*s-1

View solution in original post

0 Kudos
5 Replies
ssbkang
Enthusiast
Enthusiast
Jump to solution

Hi,

First of all, you won't be able to create a partition through vMA. You will have to SSH into the ESXi server directly and run partedUtil command.

Once you are SSHed into the ESXi server, check the naa ID:

  • cd /vmfs/devices/disks
  • Find the naa ID you would like to format. The following is a sample output, see the ":1" in the end of naa.60050768018180732000000000000e97? This represents there is a partition. The naa ID with naa.60050768018180732000000000000e9a is the one I am going to create a partition.
    • -rw-------    1 root     root       549755813888 Aug  1 03:01 naa.60050768018180732000000000000e97
    • -rw-------    1 root     root       549754748416 Aug  1 03:01 naa.60050768018180732000000000000e97:1
    • -rw-------    1 root     root        10737418240 Aug  1 03:01 naa.60050768018180732000000000000e9a
  • Copy the naa ID and run partedUtil get naa.60050768018180732000000000000e9a to get the endSector. The output is:
    • 1305 255 63 20971520
    • 20971520 is the endSector you will need.
  • Create a partition by running partedUtil set "/vmfs/devices/disks/naa.60050768018180732000000000000e9a" "1 2048 20964824 251 0"
    • If success, it won't generate any error messages.
    • startSector value is 2048 and this is for VMFS5 and VMFS3 with 8MB of Blocksize.
  • Create VMFS Volume using vmkfstools, vmkfstools -C vmfs5 -S Test_VMFS_Volume /vmfs/devices/disks/naa.60050768018180732000000000000e9a:1
  • The output will be like the following:
  • VMFS5 file system creation is deprecated on a BIOS/MBR partition on device 'naa.60050768018180732000000000000e9a:1'

        Checking if remote hosts are using this device as a valid file system. This may take a few seconds...

        Creating vmfs5 file system on "naa.60050768018180732000000000000e9a:1" with blockSize 1048576 and volume label "Test_VMFS_Volume".

        Successfully created new volume: 51f9dd19-ca313600-84d1-0015177b0113

  • Rescan the HBAs: esxcli storage core adapter rescan -a
  • Check the VMFS Volume: esxcli storage filesystem list
  • The output will be:
    • /vmfs/volumes/51f9dd19-ca313600-84d1-0015177b0113  Test_VMFS_Volume  51f9dd19-ca313600-84d1-0015177b0113     true  VMFS-5   10468982784    9546235904

Hope this helps.

Regards,

Steven.

0 Kudos
hurdle
Enthusiast
Enthusiast
Jump to solution

I guess I just don't get it.

I still don't get how you are coming up with the  numbers at the end of the command

You mention 20971520 is the end sector you need but then your command

Create a partition by running partedUtil set "/vmfs/devices/disks/naa.60050768018180732000000000000e9a" "1 2048 20964824 251 0"

does not have the number 20971520 listed anywhere in that command

0 Kudos
weinstein5
Immortal
Immortal
Jump to solution

I have moved this question to a more appropriate forum -

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
hurdle
Enthusiast
Enthusiast
Jump to solution


Never mind its C*h*s-1

0 Kudos
ssbkang
Enthusiast
Enthusiast
Jump to solution

Should have mentioned that in the beginning, you are correct, it's C*H*S - 1.