监控 esxi 虚拟机
来源:互联网 发布:ipad版淘宝怎么开店 编辑:程序博客网 时间:2024/06/05 18:00
Using VIX on VMware ESXi for system automation and configuration
This quick article has been written and assumes that you are using either the evaluation or a fully licenced copy of ESXi. as VIX will only run (fully functionally) on a 60 day evaluation or fully licensed ESXi server. Also, the guest OS will need to have had VMTools installed in order for this to work.
grab the latest set of the VIX tools from vmware.com for your architecture,ie:VMware-VIX-1.10.3-368992.x86_64.bundle.sh
run VMware-VIX-1.10.3-368992.x86_64.bundle.sh from the server you will use as your admin machine to talk to ESXi or vCenter, in my test environment I used Ubuntu 64bit 10.4 LTS, which worked great.
Once installation is complete, there are a full suite of commands that can be run against a GuestOS whilst it is ‘on’ or ‘off’, networked or not-networked.
for example:
Pull back a list of the Guests managed at that ESXi servers location ( This is a handy way of finding out all the DataStore syntax, as it has to be exact )
vmrun -T server -h https://ESXihostipaddress/sdk -u root -p passwd listRegisteredVM
This will only show the VMs that are running actively on the ESXi Host
vmrun -T server -h https://ESXihostipaddress/sdk -u root -p passwd list
vmrun -T server -h https://ESXihostipaddress/sdk -u root -p passwd -gu guestrootacct -gp guestrootpasswd readVariable “[ha-datacenter/host_DataStore] guest_VM/guest_VM.vmx” guestEnv “SHELL”
This will logon to the ESXi host and then into the VM running under the relevant Datastore, then I pass guestEnv as an command option and “SHELL” as an argument toguestEnv.
this will echo back “/bin/bash” as this is the default shell that is running on the root account on that guest.
Its also possible to manipulate files in and out of the guest, list files in directories, stop, start, clone the guest and run programs and scripts. – Using this approach you can aim towards full automation of a guest system with little need for interaction or the possibility of human error which sometimes sneaks in when your performing the same actions repeatedly.
some other command options to look at are:
runProgramInGuest
listProcessesInGuest
killProcessInGuest
runScriptInGuest
readVariable
writeVariable. – These are what I have found most useful in getting ESXi guest deployment fully automated. For example I used runScriptInGuest to run a network config script to automatically change the IP address of a newly cloned system, to pick the next address available in the range.
If you have an environment that requires some manual configuration after its been cloned, or maybe you just want to work towards a fully automated and managed environment, then I would definitely recommend that you give this a whirl. You can have a simple test set up in minutes to show the potential power that this tool offers you.
Matt Palmer – 16/07/2011
Edit: I’m part way reading through this awesome book on Automation of ESXi/vSphere using PowerCLI, and strongly suggest if your interested in making your admin tasks quicker and easier that you give it a go. I got it on Kindle so that I can annotate and flick to specific sections if I need to.
- 监控 esxi 虚拟机
- ESXI集群下大量虚拟机系统运行监控-用户密码过期
- nagios监控ESXi硬件
- esxi 打开snmp监控
- esxi 虚拟机磁盘类型
- 备份VMWare ESXi虚拟机
- esxi虚拟机相关技术
- ESXI集群下大量虚拟机系统运行监控-netstat-an连接汇总分类
- 使用Nagios监控VMware ESXi
- 用JAVA控制ESXi虚拟机
- esxi 虚拟机硬盘在线扩容
- 为ESXI虚拟机增加磁盘
- Esxi虚拟机克隆的问题
- vSphere ESXi 的虚拟机恢复
- 给ESXi虚拟机硬盘瘦身
- VMWare ESXi 6虚拟机克隆
- [ESXi 6.5] 设置ESXi宿主机开机自动启动虚拟机
- 虚拟机监控
- 动态规划DP持续分析(update)
- hdu_1754 I Hate It
- uva146 ID Codes
- Google C++ Mocking Framework for Dummies 翻译
- 男人八题系列
- 监控 esxi 虚拟机
- java中操作数组的常用工具类
- 从头到尾彻底解析Hash表算法
- 《算法竞赛-训练指南》第一章-1.19_UVa 11549
- 一、我的emacs配置--适用c/c++和python开发(https://github.com/pein0119/emacs.d)
- HDU1847:Good Luck in CET-4 Everybody!
- 第一篇
- uva10098 Generating Fast, Sorted Permutation
- java6与java5的区别