VMWare ESXI Provision - Debug常用指令

在pure IPv6環境下,可以使用以下cmd去避免dhcp取不到而發生錯誤的情形:

esxcfg-vmknic -U V4 "Management Network"

List vmknic info:

localcli network vswitch standard list
localcli network ip interface list

Add vmknic:

localcli network vswitch standard add --vswitch-name=vSwitch1
localcli network vswitch standard portgroup add --portgroup-name="VMkernel1" --vswitch-name=vSwitch1
localcli network vswitch standard portgroup add --portgroup-name="VM Network1" --vswitch-name=vSwitch1
localcli network vswitch standard uplink add --uplink-name=vmnic1 --vswitch-name=vSwitch1
localcli network ip interface add --interface-name=vmk1 --portgroup-name=VMkernel1
localcli network ip interface ipv4 set --interface-name=vmk1 --type=dhcp 
# localcli network ip interface ipv6 set --interface-name=vmk1 -d true -r true
localcli network ip interface ipv6 set --interface-name=vmk1 --enable-dhcpv6=true --enable-router-adv=true

Remove vmknic:

localcli network ip interface remove --interface-name=vmk1
localcli network vswitch standard remove --vswitch-name="vSwitch1"

Show NIC info:

[root@localhost:~] localcli network nic list
Name    PCI Device    Driver    Admin Status  Link Status  Speed  Duplex  MAC Address        MTU   Description
--------------------------------------------------------------------------------------------------------------
vmnic0  0000:03:00.0  nmlx4_en  Up            Down             0  Half    00:25:90:90:e2:d1  1500  Mellanox Technologies MT27500 Family [ConnectX-3]
vmnic1  0000:01:00.0  igbn      Up            Up            1000  Full    0c:c4:7a:1a:40:62  1500  Intel Corporation I350 Gigabit Network Connection
vmnic2  0000:01:00.1  igbn      Up            Up            1000  Full    0c:c4:7a:1a:40:63  1500  Intel Corporation I350 Gigabit Network Connection

Show IP:

[root@localhost:~] esxcfg-vmknic -l
Interface  Port Group/DVPort/Opaque Network        IP Family IP Address                              Netmask         Broadcast       MAC Address       MTU     TSO MSS   Enabled Type                NetStack
vmk0       Management Network                      IPv4      10.146.176.17                           255.255.0.0     10.146.255.255  0c:c4:7a:1a:40:62 1500    65535     true    DHCP                defaultTcpipStack

Enable SSH,登入時不需要輸入密碼: (refer link)

/etc.init.d/SSH start
~ # ps -c | grep 3600
36101 36101 sleep                sleep 3600
41757 41757 grep                 grep 3600
localcli hardware pci list