鑒於常常協助客戶安裝或重裝VMware系統常常會遇到很多PortGroup需要一個一個新增>客戶又沒有License可以使用vDS的部分
我們可以用指令先打在記事本內一次貼上這樣或許比較快一點。

https://kb.vmware.com/s/article/1008127

esxcli network vswitch standard list # list current vswitch configuration
esxcli network vswitch dvs vmware list # list Distributed Switch configuration
esxcli network ip interface list # list vmkernel interfaces and their configuration
esxcli network nic list # display listing of physical adapters and their link state

esxcli network vswitch standard uplink remove --uplink-name=vmnic --vswitch-name=vSwitch # unlink an uplink
esxcli network vswitch standard uplink add --uplink-name=vmnic --vswitch-name=vSwitch # add an uplink

esxcli network vswitch standard add --vswitch-name=vSwitch

esxcfg-vswitch -p "VM Network 1" -v 10 vSwitch1


舉例:
esxcli network vswitch standard add --vswitch-name=vSwitch3
如果已經有了會告訴你已存在[A portset with this name already exists.  Please choose another name.: Already exists]
esxcli network vswitch standard portgroup add --portgroup-name=ForVMuse --vswitch-name=vSwitch3
也可以這樣寫esxcli network vswitch standard portgroup add -p ForVMuse  -v vSwitch3

image

 

esxcli network vswitch standard portgroup add -p ForVMuseID1234  -v vSwitch3    #先新增PortGroup
esxcli network vswitch standard portgroup set -p ForVMuseID1234 --vlan-id 1234  #再修改vlanID
也可以這樣寫esxcli network vswitch standard portgroup set -p ForVMuseID1234 -v 1234  #此時針對PortGroup set的-v變成vlan-id

如果打錯ID直接在下一次改成正確的ID就會蓋過去 #esxcli network vswitch standard portgroup set -p ForVMuseID1234 --vlan-id 10

 

image

全站熱搜
創作者介紹
創作者 PIPI 的頭像
PIPI

PIPI的部落格

PIPI 發表在 痞客邦 留言(0) 人氣()