|
Virtualization -
VMware
|
|
Written by Allen Sanabria
|
|
Monday, 06 July 2009 10:06 |
|
The other day I was installing kernel updates on a few of my Red Hat servers and I ran into a minor nuisance. After each reboot, I no longer had network connectivity on the hosts, that has the updated kernel. I then realized, that vmware-tools was not running on all of those hosts. So after a few manual instance of me running "vmware-tools-config.pl -d" and "/etc/init.d/network restart"....I decided to automate that, by adding the below into "/etc/rc.local"
rkernel=`uname -r` if [ -e /etc/vmware-tools/not_configured ]; then echo "vmware-tools not configured for running kernel $rkernel" echo "running vmware-config-tools.pl" /usr/bin/vmware-config-tools.pl -d echo "vmware-tools now compiled for running kernel $rkernel" echo "restarting networking" /etc/init.d/network restart echo "network restarted" exit 0 fi
After each host rebooted, I now had network connectivity and vmware-tools was running. I hope the above will save you some time.
|
|
Last Updated on Tuesday, 07 July 2009 07:54 |
|
|
Virtualization -
VMware
|
|
Written by Allen Sanabria
|
|
Wednesday, 01 April 2009 09:33 |
|
The other day I was told to check and see if VMware Tools was installed on every Virtual Machine in our Cluster. I figured this was the perfect time for me to write another script to do this.
Here are a list of things that I want to have in the script...
- List all Virtual Machines and the VMstatus and Version if installed
- Check for toolsOK
- Check for toolsNotInstalled
- Check for toolsNotRunning
- Check for toolsOld
- And last but not least, able to do this either on a per Virtual Machine or on the entire Cluster
Well I was able to do all of the above in a nice Perl Script that I created. It can be downloaded here vmToolsStatus.pl
perl vmToolsStatus.pl help : Hiding the command line arguments [--help] --toolsOld : This will print out all the Virtual Machines with an Old version of vmTools and you need to upgrade --toolsNotInstalled : This will print out all the Virtual Machines with vmTools Not Installed --toolsNotRunning : This will print out all the Virtual Machines with vmTools Not Running --toolsOk : This will print out all Virtual Machines with vmTools running --all : This will print out all Virtual Machines with vmTools installed or not installed example : Hiding the command line arguments --toolsOld example : Hiding the command line arguments --toolsOk example : Hiding the command line arguments --toolsNotInstalled example : Hiding the command line arguments --toolsRunning example : Hiding the command line arguments --all --vm_name "vm_name" example : Hiding the command line arguments --all
Remember!!! That in order to use this script you will need the Perl VI SDK installed on your linux box as well as $home/.visdkrc setup correctly
Here is an example .visdkrc...
VI_SERVER = Virtual Console Server VI_USERNAME = login VI_PASSWORD = passwd VI_PROTOCOL = https VI_PORTNUMBER = 443
|
|
Last Updated on Wednesday, 02 September 2009 07:39 |
|
Read more...
|
|
Virtualization -
VMware
|
|
Written by Allen Sanabria
|
|
Tuesday, 31 March 2009 14:51 |
|
This is the 3rd and I think final revision of this script. I added the --list function, which before had to be combined with the --vm_name function. The main reason for creating this script was so that there can be an easy way to manage snapshots, especially automating the deletion, creation, reverting, and listing of snapshots. If you find this script or any of my scripts useful, please let me know.
perl vm_snapshot.pl --list Platinum name: test1 description: state: poweredOff vm type: VirtualMachine time created: 2009-03-17T10:26:34.605171-04:00
Gold name: test2 description: state: poweredOff vm type: VirtualMachine time created: 2009-03-17T13:32:05Z
Silver name: test3 description: state: poweredOff vm type: VirtualMachine time created: 2009-03-17T13:32:22Z
Remember!!! That in order to use this script you will need the Perl VI SDK installed on your linux box as well as $home/.visdkrc setup correctly
Here is an example .visdkrc...
VI_SERVER = Virtual Console Server VI_USERNAME = login VI_PASSWORD = passwd VI_PROTOCOL = https VI_PORTNUMBER = 443
|
|
Last Updated on Tuesday, 31 March 2009 19:05 |
|
Read more...
|
|
Virtualization -
VMware
|
|
Written by Allen Sanabria
|
|
Monday, 30 March 2009 20:28 |
|
Welcome to part 2 of the "HowTo List Virtual Machines using Python and CIM". In this part, I modified the original script so that you can pass the Virtual Machine name as well as run it with out the Virtual Machine name. In the first part of this HowTO I created the listVMsInfo.py script witch just listed all the Virtual Machines. So please enjoy the script and hopefully it will make your life just a bit easier.
python listVMsInfo.py -u "http://esxhost" -a "login passwd" -n "testVM" VM Name testVM Operating System Suse Linux Enterprise Server 10 (32-bit) Host Name None IP Address None DataStore Used [Esxtestvol] testVM.vmx Requested State Not Applicable Operational Status Enabled Enabled by Default Enabled Enabled State Not Applicable
Download this script here! listVMsInfo.py-Part-2
Download listVMsInfo.py Part 2 | | File Title: | listVMsInfo.py Part 2 (Details) | | File Type: | py | | File Version: | 1.1 | | File Size: | 4.39 Kb | | License: | | | File Author: | Allen Sanabria | | File HomePage: | | | Downloads: | 58 | | Rating: | ( Votes) | | Your Vote: | |
| |
|
|
Last Updated on Wednesday, 02 September 2009 07:39 |
|
Virtualization -
VMware
|
|
Written by Allen Sanabria
|
|
Wednesday, 25 March 2009 12:06 |
|
Good Afternoon guys, here I created another Python Script. This script will check your DataStores aka VMFS. I built this script so that it can be used with Nagios and or Zenoss. The purpose of this script is so that you can monitor thresholds on a per DataStore/VMFS. You will need to download and install Pywbem in order to use this script. You can get it here Example below...
example below... python check_datastore.py -u "http://esxhost" -a "login passwd" --d "Esxtestvol2" -w 60 -c 73 -m GB Warning Esxtestvol2 189GB Avail 62% used |avail=189
python check_datastore.py -u "http://esxhost" -a "login passwd" --d "Esxtestvol2" -w 70 -c 85 -m MB OK Esxtestvol2 194558MB Avail 61% used |avail=194558
python check_datastore.py -u "http://esxhost" -a "login passwd" --d "ISO" -w 10 -c 21 -m KB Critical ISO 41867542528KB Avail 21% used |avail=41867542528
python check_datastore.py -u "http://esxhost" -a "login passwd" --d "Esxtestvol2" -w 70 -c 85 OK Esxtestvol2 204008849408bytes Avail 61% used |avail=204008849408
-u, --url This is the URL you will use to connect to the ESX server, "http://esxhost" -a, --auth This is the Login and Passwd you will use, "login passwd" -d, --dstore This is the DataStore aka VMFS to check, "Esxtestvol2" -w, --warn This is the warning threshold that you will set, 70 -c, --crit This is the critical threshold that you will set, 85 -m, --metric This is the metric that you will use, "KB", "MB", "GB", The default is Bytes
You can download this script here check_datastore.py
Download check_esx_datastore.py | | File Title: | check_esx_datastore.py (Details) | | File Type: | py | | File Version: | 1.1 | | File Size: | 4.58 Kb | | License: | Copyright (C) 2008 Allen Sanabria
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | | File Author: | Allen Sanabria | | File HomePage: | http://www.linuxdynasty.org/howto-monitor-and-add-multiple-data-points-the-easy-way-in-zenoss.html | | Downloads: | 187 | | Rating: | ( Votes) | | Your Vote: | |
| |
|
|
Last Updated on Wednesday, 02 September 2009 08:54 |
|
Read more...
|
|
|
|
|
<< Start < Prev 1 2 3 4 Next > End >>
|
|
Page 1 of 4 |