Subversion Repositories sysadmin_scripts

Rev

Rev 116 | Rev 144 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

Set of Perl scripts to help manage virtuals

== ParseXenConfigs.pl
Just goes through all Xen config files and pulls information. Currently only looks for MAC address and checks for duplicates

== findVirtuals.pl
Designed to be put on shared storage on several hypervisors and run via cron. Determines which virtual is running on which 
hypervisor, saving it in a database (dom0_db.yaml in same directory as script), it can also display a tab delimited list
of which virtual is running on which hypervisor (-s option)

Sample crontab entry included. If run from crontab, using -r (Report Only) will only return a string if there is an update; something
added/removed/moved

All flags available by passing --help.

-s          Show database
-c filename Use alternative database
-n          Don't update the database
-v          Be Verbose (show some stats)
-r          Report - only display if something changed

== migrateDomain.pl
Does a standard migration, but does it a little different. Call with the target machine as the first parameter, followed by 1 or 
more running virtuals to be migrated. The special keyword ALL (in all caps) attempts to migrate all virtuals sequentially after
prompting for authorization.

Example:
perl migrateDomain.pl hyper1 test.example.com
   Verifies test.example.com is currently running here, then attempts to migrate it to machine hyper1

perl migrateDomain.pl hyper1 test.example.com 10 test2.example
   In turn verifies the virtuals exist and are running (test.example.com, the virtual with an ID of 10, test2.example.com), then 
   migrates them to machine hyper1.
   
perl migrateDomain.pl hyper1 ALL
   Requires you to enter the word 'Yes' (case insensitive), then sequentially migrates each virtual to hyper1

== startVirtual.pl

This will safely start a virtual by checking with findVirtuals first to see if the domain is running on another hypervisor