Skip to content

虛擬機器

KVM

Virual Box

Hype V

Network

eth0 is from internal type hype-v switch

root@homelab:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:00:8b:10 brd ff:ff:ff:ff:ff:ff
    inet 192.168.137.2/24 brd 192.168.137.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::215:5dff:fe00:8b10/64 scope link
       valid_lft forever preferred_lft forever
root@homelab:~#
# This is the network config written by 'subiquity'
network:
  ethernets:
    eth0:
      addresses: [ 192.168.137.2/24 ]
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]
      routes:
      - to: default
        via: 192.168.137.1
  version: 2

Rocky Linux

VMware

ESXi

bootstate=0
title=Loading ESXi installer
timeout=5
prefix=ESXi-8.0U1a-21813344
kernel=b.b00
kernelopt=runweasel cdromBoot ks=http://172.19.57.10:8000/ks.cfg
modules=jumpstrt.gz --- useropts.gz --- features.gz --- k.b00 --- uc_intel.b00 --- uc_amd.b00 --- uc_hygon.b00 --- procfs.b00 --- vmx.v00 --- vim.v00 --- tpm.v00 --- sb.v00 --- s.v00 --- atlantic.v00 --- bcm_mpi3.v00 --- bnxtnet.v00 --- bnxtroce.v00 --- brcmfcoe.v00 --- cndi_igc.v00 --- dwi2c.v00 --- elxiscsi.v00 --- elxnet.v00 --- i40en.v00 --- iavmd.v00 --- icen.v00 --- igbn.v00 --- intelgpi.v00 --- ionic_en.v00 --- irdman.v00 --- iser.v00 --- ixgben.v00 --- lpfc.v00 --- lpnic.v00 --- lsi_mr3.v00 --- lsi_msgp.v00 --- lsi_msgp.v01 --- lsi_msgp.v02 --- mtip32xx.v00 --- ne1000.v00 --- nenic.v00 --- nfnic.v00 --- nhpsa.v00 --- nmlx5_co.v00 --- nmlx5_rd.v00 --- ntg3.v00 --- nvme_pci.v00 --- nvmerdma.v00 --- nvmetcp.v00 --- nvmxnet3.v00 --- nvmxnet3.v01 --- pvscsi.v00 --- qcnic.v00 --- qedentv.v00 --- qedrntv.v00 --- qfle3.v00 --- qfle3f.v00 --- qfle3i.v00 --- qflge.v00 --- rdmahl.v00 --- rste.v00 --- sfvmk.v00 --- smartpqi.v00 --- vmkata.v00 --- vmksdhci.v00 --- vmkusb.v00 --- vmw_ahci.v00 --- bmcal.v00 --- clusters.v00 --- crx.v00 --- elx_esx_.v00 --- btldr.v00 --- esx_dvfi.v00 --- esx_ui.v00 --- esxupdt.v00 --- tpmesxup.v00 --- weaselin.v00 --- esxio_co.v00 --- loadesx.v00 --- lsuv2_hp.v00 --- lsuv2_in.v00 --- lsuv2_ls.v00 --- lsuv2_nv.v00 --- lsuv2_oe.v00 --- lsuv2_oe.v01 --- lsuv2_sm.v00 --- native_m.v00 --- qlnative.v00 --- trx.v00 --- vdfs.v00 --- vds_vsip.v00 --- vmware_e.v00 --- vsan.v00 --- vsanheal.v00 --- vsanmgmt.v00 --- tools.t00 --- xorg.v00 --- gc.v00 --- imgdb.tgz --- basemisc.tgz --- resvibs.tgz --- esxiodpt.tgz --- imgpayld.tgz
build=8.0.1-0.10.21813344
updated=0
# Sample ESXi Kickstart Configuration File

# Accept the VMware End User License Agreement
vmaccepteula

# Set the root password
# rootpw foo@123

# Set the root password (same as above to ensure it's set)
# rootpw --iscrypted <hashed_password_here>
# $6$GPVUoEU3hYSLkzZJ$9IuUjJm1L6AbBj3KMeU9gMYbcCObyq.C5fmUMTJMjf1lIbMLfIDVkIWbOD0CkaJYGmgSSzlcvjlDRg8l66x0J1 from openssl passwd -6 "Super123"
rootpw --iscrypted $6$GPVUoEU3hYSLkzZJ$9IuUjJm1L6AbBj3KMeU9gMYbcCObyq.C5fmUMTJMjf1lIbMLfIDVkIWbOD0CkaJYGmgSSzlcvjlDRg8l66x0J1

# Install ESXi on the first local disk (overwrite VMFS partitions)
install --firstdisk --overwritevmfs

# Set the keyboard layout
# keyboard 'US'

# Set the root password (same as above to ensure it's set)
# rootpw --iscrypted <encrypted_password_here>

# Network configuration
# network --bootproto=static --device=vmnic0 --ip=172.19.57.50 --netmask=255.255.255.0 --gateway=172.19.57.1 --nameserver=8.8.8.8 --hostname=jeffesxi1
network --bootproto=dhcp --device=vmnic0
# Reboot the server after installation
reboot

# Enable SSH and allow remote SSH access
%firstboot --interpreter=busybox

# Enable SSH session for remote access
vim-cmd hostsvc/enable_ssh

# Start the SSH service
vim-cmd hostsvc/start_ssh

# Enable ESXi Shell
vim-cmd hostsvc/enable_esx_shell
vim-cmd hostsvc/start_esx_shell

#Disable firewall
#esxcli network firewall set --enabled false

# Configure firewall to allow SSH access
# esxcli network firewall ruleset set -e true -r sshClient


# Enable the SSH server firewall ruleset
esxcli network firewall ruleset set --enabled=true --ruleset-id=sshServer

# Enable the SSH client firewall ruleset
esxcli network firewall ruleset set --enabled=true --ruleset-id=sshClient

# End of firstboot commands
customized boot.cfg

多網卡情境 multiple interfaces and need to assgin the specific interface

kernelopt=netdevice=vmnic1 bootproto=dhcp ks=http://192.168.1.100/ks/ks.cfg
kernelopt=netdevice=vmnic1 ip=192.168.1.50 netmask=255.255.255.0 gateway=192.168.1.1 nameserver=8.8.8.8 ks=http://192.168.1.100/ks/ks.cfg

ansible

``` yml= - name: validate ansible to esxi hosts: all gather_facts: yes vars: - esxi_server: 192.168.1.102 - esxi_username: root - esxi_password: myp@ssw0rd tasks: - name: Provide information about a standalone ESXi server community.vmware.vmware_about_info: hostname: '{{ esxi_server }}' username: '{{ esxi_username }}' password: '{{ esxi_password }}' validate_certs: no delegate_to: localhost register: esxi_about_info - name: Gather vmware host facts community.vmware.vmware_host_facts: hostname: "{{ esxi_server }}" username: "{{ esxi_username }}" password: "{{ esxi_password }}" validate_certs: no register: host_facts delegate_to: localhost - name: tset ssh shell: cmd: "esxcli" register: esxcli_result #- name: change host name - method 1 - Update the TCP/IP stack configuration of the default # community.vmware.vmware_host_tcpip_stacks: # hostname: "{{ esxi_server }}" # username: "{{ esxi_username }}" # password: "{{ esxi_password }}" # validate_certs: no # esxi_hostname: "sanfrancisco-a-esxi.example.com" # default: # hostname: "abc" # domain: example.com # preferred_dns: 8.8.8.8 # search_domains: # - example.com # delegate_to: localhost - name: change host name - method 2 shell: cmd: "esxcli system hostname set --host=sanfrancisco-a-esxi" register: esxcli_change_hostname_result - name: show info debug: msg: - "{{ esxi_about_info }}" - "{{ host_facts }}" - "{{ esxcli_result }}" #- "{{ esxcli_change_hostname_result }}" - "{{ ansible_facts }}"

#### Network
- [VMware ESXi 7 : Add VMkernel NIC : Server World](https://www.server-world.info/en/note?os=ESXi_7&p=network&f=4)
- [Link state up or down for a vmnic interface on ESXi](https://knowledge.broadcom.com/external/article/324496/link-state-up-or-down-for-a-vmnic-interf.html)
- [Configuring vSwitch or vNetwork Distributed Switch from the command line in ESXi/ESX](https://knowledge.broadcom.com/external/article/326175)
    - [VMware ESXi 7 : Add Uplink : Server World](https://www.server-world.info/en/note?os=ESXi_7&p=network&f=3)
- [Restarting the Management agents in ESXi](https://knowledge.broadcom.com/external/article/320280/restarting-the-management-agents-in-esxi.html)
    - [How to restart the ESXi management network via command-line?](https://williamlam.com/2014/01/how-to-restart-esxi-management-network.html)
- [How to enable or disable vmnic on esxi - Hasan Altin](https://www.hasanaltin.com/how-to-enable-or-disable-vmnic-on-esxi/)
- [Network Access to Your ESXi Host](https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.esxi.install.doc/GUID-6219B45D-036F-4D38-B6A2-BF404A3304EC.html)
- :star:[VMware homelab [Part 3]: How to configure vSphere networking and storage | jimangel.io](https://www.jimangel.io/posts/vmware-series-p3-network-storage/)
esxcli network nic list esxcli network nic up -n vmnic1 esxcli network nic down -n vmnic1 esxcli network ip interface set -e false -i vmk0; esxcli network ip interface set -e true -i vmk0 esxcli network vswitch standard uplink add --vswitch-name vSwitch0 --uplink-name vmnic1 esxcli network vswitch standard uplink remove --vswitch-name vSwitch0 --uplink-name vmnic0 esxcli network ip interface ipv4 get esxcli network vswitch standard list

esxcli network nic list | awk '{print $1,$5,$8}' | grep vmnic

esxcli network nic list | awk '{print $1,$5,$8}' | grep vmnic | while read -r interface status mac_address; do echo "Interface: $interface" echo "Status: $status" echo "MAC Address: $mac_address" echo "" if [ "$status" = "Down" ]; then echo "Status is Down. Executing command: network vswitch standard uplink remove --vswitch-name vSwitch0 --uplink-name $interface" network vswitch standard uplink remove --vswitch-name vSwitch0 --uplink-name "$interface" fi done

Currently, can not get the ip after the operations
the problem maybe the mac address will not be changed successfully after changing uplink
esxcli network ip interface ipv4 get esxcli network ip interface list esxcli network vswitch standard list esxcli network vswitch standard uplink add --vswitch-name vSwitch0 --uplink-name vmnic3 esxcli network vswitch standard uplink remove --vswitch-name vSwitch0 --uplink-name vmnic0 esxcli network vswitch standard list esxcli network ip interface set -e false -i vmk0; esxcli network ip interface set -e true -i vmk0 esxcli network ip interface ipv4 get esxcli network ip interface list ```

vGPU

PCI Passthrough

Plug-in

vCenter

vLCM

VIBs

A VIB is a software package that contains metadata and a binary payload, which represents the actual piece of software to be installed on ESXi.

類似deb, rpm

the VIB is the smallest installable software unit that VMware and other software vendors ship.

vSphere Lifecycle Manager does not consume and work with individual VIBs. VIBs must be further packaged into a higher-level construct.

Bulletins

The bulletin is a grouping of one or more VIBs. Bulletins are defined within the metadata of the VIB.

You use bulletins, and not individual VIBs, to create vSphere Lifecycle Manager baselines, which you attach to inventory objects and use to update and upgrade ESXi hosts.

Components

Starting with vSphere 7.0, the component becomes the basic packaging construct for VIBs. VMware, OEMs, and third-party software providers now deliver software in the form of components.

The component is a bulletin with additional metadata specifying the name and the version of the component.

Unlike the bulletin, the component is a logical grouping of VIBs that provides you with a complete and visible feature upon installation.

VMware bundles components together into fully functional and bootable ESXi base images. OEMs bundle components together into vendor add-ons. Third-party software vendors create and ship software, for example drivers or adapters, as independent components.

Base Images

The base image is an ESXi image that VMware provides with every release of ESXi

The base image is a collection of components that is complete and can boot up a server.

Vendor Add-Ons

OEMs pack one or multiple components into a unit called an add-on.

You use vendor add-ons to customize an ESXi image with OEM content and drivers.

The combination of a vendor add-on and an ESXi base image is practically identical to an OEM-provided custom image.

Starting with vSphere 7.0, in addition to custom ISO images and offline bundles, OEMs can release ZIP files that contain only the vendor add-on, that is, the delta between the custom image and the ESXi base image.