
创建一键更新虚拟机mac
vim /proxmox_batch_update_all_vm_mac.sh
#!/bin/bash# PVE virtual machine configuration file path
pve_conf_path="/etc/pve/qemu-server/"# Error handling function
die() {echo >&2 "[ERROR] $@"exit 1
}# Generate a valid random MAC address
# Ensure it's a locally administered unicast address (to avoid conflicts with physical devices)
generate_valid_mac() {# First byte: locally administered (7th bit = 1) + unicast (8th bit = 0)local first_byte_list=("02" "06" "0A" "0E")local first_byte=${first_byte_list[$((RANDOM % ${#first_byte_list[@]}))]}# Generate remaining 5 random byteslocal o