Sunday, 5 March 2017

VCAP-DCV :: Scratch partition configuration CLI

This procedure describe how to configure the Scratch partition using command line. This is fast and efficient - you need just login via SSH to your ESXi host.

1.) Login over SSH to ESXi host using e.g. Putty client or your terminal

2.) List your datastores 

# ls -l /vmfs/volumes/
total 3853
drwxr-xr-x    2 root     root             2 Jan 25 14:11 261b69b6-ffae9bb2
drwxr-xr-x    1 root     root             8 Jan  1  1970 5702fb79-60862c63-10b0-00505686d3de
drwxr-xr-t    1 root     root          2240 Feb  3 22:00 586410df-c23471a2-3d4a-0050568d2637
drwxr-xr-t    1 root     root          2240 Jan 28 14:29 586ac78b-5cf531fa-ca96-0050568d14b3
drwxr-xr-t    1 root     root          1680 Jan 30 21:35 588fb028-72e8890a-70ec-0050568d14b3
drwxr-xr-x    1 root     root             8 Jan  1  1970 9f691e7f-5aef34de-7c69-e495051b6cfd
lrwxr-xr-x    1 root     root            35 Mar  5 12:18 Datastore -> 588fb028-72e8890a-70ec-0050568d14b3
lrwxr-xr-x    1 root     root            17 Mar  5 12:18 NFS1 -> 261b69b6-ffae9bb2
lrwxr-xr-x    1 root     root            17 Mar  5 12:18 NFS2 -> a0e23f58-ef2c88ee
lrwxr-xr-x    1 root     root            17 Mar  5 12:18 NFS3 -> f4efbfa1-5ca3209a
drwxr-xr-x    4 root     root             9 Jan 26 14:07 a0e23f58-ef2c88ee
drwxr-xr-x    1 root     root             8 Jan  1  1970 bba0137d-45163325-50f6-9fce85fbd663
drwxr-xr-x    8 root     root            10 Jan 30 20:40 f4efbfa1-5ca3209a
lrwxr-xr-x    1 root     root            35 Mar  5 12:18 vmfs_lun01 -> 586410df-c23471a2-3d4a-0050568d2637
lrwxr-xr-x    1 root     root            35 Mar  5 12:18 vmfs_lun02 -> 586ac78b-5cf531fa-ca96-0050568d14b3
drwxr-xr-x    1 root     root           512 Mar  5 12:18 vsan:52825487009e5756-95ec4b21262a513d

lrwxr-xr-x    1 root     root            38 Mar  5 12:18 vsanDatastore -> vsan:52825487009e5756-95ec4b21262a513d

3.) We want to set Scratch partition on vmfs_lun01

# ls -la /vmfs/volumes/vmfs_lun01
lrwxr-xr-x    1 root     root            35 Mar  5 12:22 /vmfs/volumes/vmfs_lun01 -> 586410df-c23471a2-3d4a-0050568d2637

4.) We need to create the .locker directory on the vmfs_lun01

# mkdir /vmfs/volumes/vmfs_lun01/.locker-$(hostname)

5.) Check if the directory was created:

# ls -lad /vmfs/volumes/vmfs_lun01/.locker*
drwxr-xr-x    1 root     root           280 Mar  5 12:28 /vmfs/volumes/vmfs_lun01/.locker-vesxi60-2

6.) Check the current Scratch Partition settings (in this case there is no Scratch partition configured)

[root@vesxi60-2:~] vim-cmd hostsvc/advopt/view ScratchConfig.ConfiguredScratchLocation
(vim.option.OptionValue) [
   (vim.option.OptionValue) {
      key = "ScratchConfig.ConfiguredScratchLocation",
      value = ""
   }
]

7.) Set the new Scratch partition on vmfs_lun01

# /bin/vim-cmd hostsvc/advopt/update ScratchConfig.ConfiguredScratchLocation string /vmfs/volumes/vmfs_lun01/.locker-vesxi60-2

# vim-cmd hostsvc/advopt/view ScratchConfig
(vim.option.OptionValue) [
   (vim.option.OptionValue) {
      key = "ScratchConfig.ConfiguredScratchLocation",
      value = "/vmfs/volumes/586410df-c23471a2-3d4a-0050568d2637/.locker-vesxi60-2"
   }
]

8.) Put host into Maintenance Mode and Reboot

# esxcli system maintenanceMode get
Disabled

# esxcli system maintenanceMode set -e 1

# esxcli system shutdown reboot -r "Scratch partition set"


More methods to set scratch partition you can find in VMware KB :

















1 comment:

  1. As claimed by Stanford Medical, It's in fact the SINGLE reason this country's women live 10 years longer and weigh an average of 42 pounds less than we do.

    (By the way, it really has NOTHING to do with genetics or some secret exercise and EVERYTHING related to "HOW" they eat.)

    P.S, What I said is "HOW", and not "WHAT"...

    CLICK this link to discover if this easy quiz can help you release your true weight loss potential

    ReplyDelete