VMware部署与管理的全面指南
1. 虚拟机操作模块
1.1 虚拟机状态操作
可以对虚拟机的状态进行操作,如重启、关机等。以下是重启虚拟机的示例代码:
username: "{
{ vsphere_username }}"
password: "{
{ vsphere_password }}"
validate_certs: "no"
folder: "/vms"
name: "yet_another_example_vm"
state: "reboot-guest"
delegate_to: localhost
也可以对虚拟机的电源状态进行定时更改,例如在2019年4月1日上午9点关闭虚拟机:
- name: April fools
vmware_guest_powerstate:
hostname: "{
{ vsphere_host }}"
username: "{
{ vsphere_username }}"
password: "{
{ vsphere_password }}"
validate_certs: "no"
folder: "/vms"
name: "yet_another_example_vm"
state: "powered-off"
scheduled_at: "01/04/2019 09:00"
dele
超级会员免费看
订阅专栏 解锁全文
54

被折叠的 条评论
为什么被折叠?



