VMware ezmomi工具使用

用两个静态IP克隆模板:
ezmomi clone --template centos67 --hostname test01 --cpus 2 --mem 4 --ips 172.10.16.203 172.10.16.204


克隆启动后可选择运行命令/脚本:
ezmomi clone --template centos6 --hostname test01 --cpus 2 --mem 4 --ips 172.10.16.203 172.10.16.204 --post-clone-cmd /usr/local/bin/additional-provisioning-steps.sh
这个例子将运行在同一台主机ezmomi上的/usr/local/bin/additional-provisioning-steps.sh。您可以EZMOMI_CLONE_HOSTNAME在脚本中引用环境变量以检索--hostname
克隆一个模板,并把VM是特定的文件夹
ezmomi clone --server vcenter_url --template centos67 --hostname test01 --cpus 2 --mem 4 --destination-folder "/DC/folder/" --ips 172.10.16.203 172.10.16.204
ezmomi shutdown --name test01

ezmomi powerOn --name test01
ezmomi powerOff --name test01
ezmomi status --name test01
# for much more information add --extra:
ezmomi status --name test01 --extra
ezmomi destroy --name test01


ezmomi listSnapshots --help
ezmomi createSnapshot --help
ezmomi removeSnapshot --help
ezmomi revertSnapshot --help


ezmomi list --type VirtualMachine
ezmomi list --type Network
ezmomi list --type Datastore


禁用ssl警告
ezmomi --no-ssl-verify [command] [options]
 
将虚拟机的时间与ESXi主机同步
ezmomi syncTimeWithHost --name somevm01


配置文件:
[root@admin-node main]# cat /root/.config/ezmomi/config.yml
# config.yml
# ezmomi

# Mail setup for notifications
mail: true
mailserver: localhost
mailfrom:  zhangjian@cditv.tv
mailto: min@example.com

# vCenter connection settings
server: 10.10.0.20
port: 443
username: "admin.xxxxx.local"
password: "xxxxxxxxxx"

# New VM defaults
cpus: 2
mem: 4
template: centos65
domain: example

dns_servers: ['8.8.8.8','1.1.1.1']

# List your networks here
networks:
  '10.10.0.200/24':
    datacenter: 'DataCenter'  #必填在配置文件中
    cluster:    'Cluster'     #必填
    datastore:  'iscsi-1T-freenas' #必填
    network:    'docker-acc'  #必填
    gateway:    '10.10.0.254' #可以选择

  







原文地址:https://www.cnblogs.com/kuku0223/p/9013729.html