Friday, April 19, 2019

Understanding Esxi Partitions

Have you ever looked at the boot disk of your enviroment and wondered what exactly do those entries represent?  I am talking about :1, :2 and so forth... Have you ever wondered if your boot disk has the same number of partitions, or is the number potentially different when comparing two esxi hosts?



Let's take a look at the boot disk in this case. All your drives are listed in /dev/disks, which is a link to /vmfs/devices/disks. The way you recognize the boot disk is by looking at all the partitions of such drive.  The boot disk is the only one that has so many partitions.




To understand the type of partitions that exist in the boot disk, simply use the partedUtil command. This command creates, removes and list partitions. Use the --help command to see all the options. In this case, we query the boot disk and see several partitions.




Partition Breakdowns 

Let us start with partition 1. This 4mb partition contains the bootloader.

Partition 2 (4gbs in size) is used as the scratch partition. The output of vm-support is located there.

Partition 5 (250mb) is your bootbank. The hypervisor's image is located here.

Partition 6 (250) is your alt bootbank. This is used when upgrading esxi hosts.

Partition 7 is used for the Purple Screens of Death. It's 110mb in size.

Partition 8 is used to store the vmware tools images.

Final Note: Be aware that your boot disk could also have a vmfs partition. This happens for example when installing esxi on a sata disk (like in a lab). Not created on flash memory.

Wednesday, January 9, 2019

The D.C.L.I. (Datacenter CLI)

What is the DCLI?  The DCLI is one of the newest command line interfaces available in vSphere. It can be used interactively or via scriptable mode. Here are a few examples of commands available. These commands were run from a linux (ubuntu) vm.

Note: These commands will only work if you take care of the certificates ahead of time. 

Run the following command to get started with the DCLI


Run this command to view the existing datastores


Run the following command to get a list of the existing vms


This command will show any resource pools


Run partial command to view the capabilities of the DCLI





Have fun...

Tuesday, November 13, 2018

7 vSAN 6.7 Changes you may have missed

1. The Performance Service is now enabled by default.


2. The older ClomRepairDelay parameter can be changed at the cluster level. Also, swap objects are thin provision by default now.


3. VM Storage Policies can be created with the vSphere Client.


 4. The Health Service looks very different.


5. VASA is now internally managed and we use VASA version 3.


6. Trim/Unmap can be enabled via the RVC.


7. There are new Proactive Tests.


How to create VM Storage Policies for vSAN 6.7U1

1. Go to the Home page in the vSphere Client and click on VM Storage Policies.


2. Click on Create VM Storage Policy.



3. Name your policy.


4. Click on Enable rules for vSAN storage.


5. Look at the options available for either regular or stretched clusters.




6. Select your Raid level. 


7. Click on Advanced Policy Rules to view other options.


8. Select your vSAN Datastore.


9. Click on Finish.


10. Verify that the policy was created.


Friday, September 7, 2018

vSAN 6.7U1 Captures


vSAN 6.7U1 finally lets you create a vSAN cluster with the new vSphere Client



There is a new Cluster quickstart...


It allows you to add hosts and create a dvs very easily...




Services like dedup and compression, encryption and iscsi can be easily configured now.


 Same applies to disk groups...

The Health UI is very different as you can see...



Takes a while to get used to...


VMworld Vegas 2018








Thursday, May 24, 2018

vSAN Cluster via PowerCli



Building a vSAN cluster with PowerCLI

Step 1: Connect to the vCenter Server
connect-viserver sa-vcsa-01.vclass.local

Step 2: Create a datacenter
new-datacenter -Location (get-folder -norecursion) -name “javier datacenter”

Step 3: Add your servers to your datacenter
add vmhost sa-esxi-02.vclass.local -location “javier datacenter” -user root -password VMware1!
add vmhost sa-esxi-03.vclass.local -location “javier datacenter” -user root -password VMware1!

Step 4: Create a distributed virtual switch for vSAN
new-vdswitch -name vsanswitch -location “javier datacenter”
get-vdswitch -name vsanswitch | new vdportgroup -name vsanpg
get-vdswitch -name vsanswitch | add vdswitchvmhost -vmhost sa-esxi-01.vclass.local, sa-esxi-02.vclass.local, sa-esxi-03.vclass.local
$nic1=get-vmhost sa-esxi-01.vclass.local | get  vmhostnetworkadapter -physical -name vmnic3
$nic2=get-vmhost sa-esxi-02.vclass.local | get  vmhostnetworkadapter -physical -name vmnic3
$nic3=get-vmhost sa-esxi-03.vclass.local | get  vmhostnetworkadapter -physical -name vmnic3
get-vdswitch vsanswitch | add-vdswitchphysicalnetworkadapter -vmhostphysicalnic $nic1
get-vdswitch vsanswitch | add-vdswitchphysicalnetworkadapter -vmhostphysicalnic $nic2
get-vdswitch vsanswitch | add-vdswitchphysicalnetworkadapter -vmhostphysicalnic $nic3
new-vmhostnetworkadapter -vmhost sa-esxi-01.vclass.local -portgroup vsanpg -virtualswitch vsanswitch -IP 10.10.10.201 -subnetmask 255.255.255.0 -vsantrafficenabled $true
new-vmhostnetworkadapter -vmhost sa-esxi-02.vclass.local -portgroup vsanpg -virtualswitch vsanswitch -IP 10.10.10.202 -subnetmask 255.255.255.0 -vsantrafficenabled $true
new-vmhostnetworkadapter -vmhost sa-esxi-03.vclass.local -portgroup vsanpg -virtualswitch vsanswitch -IP 10.10.10.203 -subnetmask 255.255.255.0 -vsantrafficenabled $true

Step 5: Create a cluster enabled for vSAN and DRS
new-cluster -name “javier cluster” -vsanenabled -drsenabled -location “javier datacenter”

Step 6: Add the servers to the cluster and then enable HA
get-vmhost sa-esxi-01.vclass.local | move-vmhost -Destination “Javier cluster”
get-vmhost sa-esxi-02.vclass.local | move-vmhost -Destination “Javier cluster”
get-vmhost sa-esxi-03.vclass.local | move-vmhost -Destination “Javier cluster”
set-cluster -cluster “Javier cluster” -HAEnabled:$true
get-cluster
get-vsanclusterconfiguration

Step 7: Create the diskgroups for the hosts
new-vsandiskgroup -vmhost sa-esxi-01.vclass.local -ssdcanonicalname mpx.vmhba0:C0:T1:L0                     -datadiskcanonicalname mpx.vmhba0:C0:T2:L0, mpx.vmhba0:C0:T3:L0
new-vsandiskgroup -vmhost sa-esxi-02.vclass.local -ssdcanonicalname mpx.vmhba1:C0:T1:L0                     -datadiskcanonicalname mpx.vmhba1:C0:T2:L0, mpx.vmhba1:C0:T3:L0
new-vsandiskgroup -vmhost sa-esxi-03.vclass.local -ssdcanonicalname mpx.vmhba1:C0:T1:L0                     -datadiskcanonicalname mpx.vmhba1:C0:T2:L0, mpx.vmhba1:C0:T3:L0

Step 8: Verify disk and disk group related information
get-datastore
get-vsandiskgroup
get-vsandisk
get-vsanspaceusage
get-vsanfaultdomain

Step 9: Create a fault domain with two servers
new-vsanfaultdomain -name domain1 -vmhost sa-esxi-01.vclass.local, sa-esxi-02.vclass.local

Step 10: Add a host to your fault domain
set-vsanfauldomain domain1 -addvmhost sa-esxi-03.vclass.local

Step 11: Remove the third host from the fault domain
set-vsanfaultdomain domain1 -removehost sa-esxi-03.vclass.local

Step 12: Remove the fault domain
remove-vsanfaultdomain domain1

Step 13: Create two vsan virtual machine storage policies
get-command “*spbm*”
get-spbmstoragepolicy
get-spbmcapability VSAN*
new-spbmstoragepolicy -name PFTT=2 -anyrulesets (new-spbmruleset (new-spbmrule -Capability (get-spbmcapability -Name “VSAN.hostFailuresToTolerate”) -Value 2 ) )
new-spbmstoragepolicy -name RAID10 -anyrulesets (new-spbmruleset (new-spbmrule -Capability (get-spbmcapability -Name “VSAN.hostFailuresToTolerate”) -Value 1 ), (new-spbmcapability -name “VSAN.stripeWidth” ) -Value 2) )

Step 14: Export one of the policies
export-spbmstoragepolicy -storagepolicy RAID10 -filepath C:\

Step 15: Remove a policy that is not in use
remove-spbmstoragepolicy -storagepolicy RAID10