#!/usr/bin/env python #参考https://github.com/vmware/pyvmomi/blob/master/sample/poweronvm.py """ Python program for powering on vms on a host on which hostd is running """ from __future__ import print_function from pyVim.connect import SmartConnect, Disconnect from pyVmomi import vim, vmodl import argparse import atexit import getpass import sys import ssl def GetArgs(): """ Supports the command-line arguments listed below. """ parser = argparse.ArgumentParser(description='Process args for powering on a Virtual Machine') parser.add_argument('-s', '--host', required=True, action='store', help='Remote host to connect to') parser.add_argument('-o', '--port', type=int, default=443, action='store', help='Port to connect on') parser.add_argument('-u', '--user
python结合pyvmomi批量关闭vmware虚拟机
最新推荐文章于 2022-07-21 10:16:52 发布
本文介绍如何利用Python的PyVMomi库,实现对VMware环境中的虚拟机进行批量关闭操作,提升自动化运维效率。
摘要由CSDN通过智能技术生成