Tuesday, October 29, 2019

Some cool esxcli iscsi commands

1. Is iSCSI enabled?

# esxcli iscsi software get
true

2. Which vmhba is used for iSCSI?

# esxcli iscsi adapter list
Adapter  Driver     State   UID                                         Description
-------  ---------  ------  ------------------------------------------  ----------------------
vmhba65  iscsi_vmk  online  iqn.1998-01.com.vmware:sa-esxi-02-400f0480  iSCSI Software Adapter

3. Which vmkernel port is used for iSCSI?

# esxcli iscsi networkportal list
vmhba65
   Adapter: vmhba65
   Vmknic: vmk3
   MAC Address: 00:50:56:01:c1:ba
   MAC Address Valid: true
   IPv4: 172.20.13.52
   IPv4 Subnet Mask: 255.255.255.0
   IPv6:
   MTU: 1500
   Vlan Supported: true
   Vlan ID: 0
   Reserved Ports: 63488~65536
   TOE: false
   TSO: true
   TCP Checksum: false
   Link Up: true
   Current Speed: 10000
   Rx Packets: 2888785
   Tx Packets: 838121
   NIC Driver: nvmxnet3
   NIC Driver Version: 2.0.0.27
   NIC Firmware Version: NA
   Compliant Status: compliant
   NonCompliant Message:
   NonCompliant Remedy:
   Vswitch: dvs-SA-Datacenter
   PortGroup: DvsPortset-0
   VswitchUuid: 50 2b 40 6e 00 70 b4 d4-66 93 6e 79 fa 6b bb c4
   PortGroupKey: dvportgroup-55
   PortKey: 8
   Opaque Network Id:
   Opaque Network Type:
   External Id:
   Duplex:
   Path Status: active

Some cool esxcli system commands

1. How to view your vSphere version

# esxcli system version get
   Product: VMware ESXi
   Version: 6.7.0
   Build: Releasebuild-8169922
   Update: 0
   Patch: 0

2. To view hostname and domain name

# esxcli system hostname get
   Domain Name: vclass.local
   Fully Qualified Domain Name: sa-esxi-02.vclass.local
   Host Name: sa-esxi-02

3. To view local users

# esxcli system account list
User ID  Description
-------  -------------------------------------------
root     Administrator
dcui     DCUI User
vpxuser  VMware VirtualCenter administration account

4. To view permissions for local users

# esxcli system permission list
Principal  Is Group  Role   Role Description
---------  --------  -----  ------------------
dcui          false  Admin  Full access rights
root          false  Admin  Full access rights
vpxuser       false  Admin  Full access rights

5. To view specific advanced settings

# esxcli system settings advanced list -t UserVars | more
   Path: /UserVars/ActiveDirectoryPreferredDomainControllers
   Type: string
   Int Value: 0
   Default Int Value: 0
   Min Value: 0
   Max Value: 0
   String Value:
   Default String Value:
   Valid Characters: *
   Description: Preferred Domain Controllers for Active Directory

   Path: /UserVars/ActiveDirectoryVerifyCAMCertificate
   Type: integer
   Int Value: 1
   Default Int Value: 1
   Min Value: 0
   Max Value: 1
   String Value:
   Default String Value:
   Valid Characters:
   Description: Enable or disable verification of SSL certificate for vSphere Authentication Proxy server

   Path: /UserVars/ESXiShellTimeOut
   Type: integer
   Int Value: 0
   Default Int Value: 0
   Min Value: 0
   Max Value: 86400
   String Value:
   Default String Value:
   Valid Characters:
   Description: Time before automatically disabling local and remote shell access (in seconds, 0 disables).  Takes effect after the services are restarted.
...

Wednesday, June 5, 2019

NSX-T 2.4 Test Drive

Log in as admin using the NSX Manager Simplified UI after deploying the first NSX Manager Node via ovf/ova. These can also be installed using KVM.


Register the Computer Managers (vCenters) with NSX:





Create a Management Cluster with 3 nsx appliances and configure the Virtual IP:


Verify the state of your cluster:



Get Comfortable with the Simplified AND Advanced user Interfaces. Be aware that the terminology varies depending on the Interface you are using.



Add Transport Nodes, Transport Zones, IP Pools and N-VDSs:






If you enable SSH, learn about commands:






Take a look at the Dashboards:



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...