Last active
August 4, 2020 14:23
-
-
Save pd12bbf7608ae1/9c1efbcc01348688f01375b0fc709cba to your computer and use it in GitHub Desktop.
ESXi 远程自动化常用命令
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ESXi远程自动化常用命令 | |
# rm -f ./backup/rui.crt ./backup/rui.key # 删除旧的备份证书 | |
# scp root@esxi:/etc/vmware/ssl/rui.key root@esxi:/etc/vmware/ssl/rui.crt ./backup/ # 备份现有证书 | |
# scp ./rui.crt ./rui.key root@esxi:/etc/vmware/ssl/ ## 复制证书 | |
# ssh root@esxi "/bin/services.sh restart" ## 重启管理服务 | |
# esxcli.py network ip interface ipv4 address list ## ESXi shell 列出ipv4地址 | |
# esxcli.py network ip interface ipv6 address list ## ESXi shell 列出ipv6地址 | |
# esxcli system hostname set --fqdn=esxi ## ESXi shell 设定主机名 | |
# esxcli system version get ##ESXi 版本查询 | |
# esxcli software vib update -d /vmfs/volumes/<your_datastore>/update-from-esxi5.5-5.5_update02-2068190.zip ##ESXi升级包 | |
# ssh root@esxi "esxcli.py network ip interface ipv4 address list" | grep "vmk0" | awk '{printf $2}' ## 远程获得ESXi ipv4地址 | |
# ssh root@esxi "esxcli.py network ip interface ipv6 address list" | grep "vmk1" | grep -v " fe80" | tail -n 1 | awk '{printf $2}' #### 远程获得ESXi ipv4地址 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment