113 |
rodolico |
1 |
Set of Perl scripts to help manage virtuals
|
|
|
2 |
|
116 |
rodolico |
3 |
== ParseXenConfigs.pl
|
113 |
rodolico |
4 |
Just goes through all Xen config files and pulls information. Currently only looks for MAC address and checks for duplicates
|
|
|
5 |
|
116 |
rodolico |
6 |
== findVirtuals.pl
|
113 |
rodolico |
7 |
Designed to be put on shared storage on several hypervisors and run via cron. Determines which virtual is running on which
|
|
|
8 |
hypervisor, saving it in a database (dom0_db.yaml in same directory as script), it can also display a tab delimited list
|
|
|
9 |
of which virtual is running on which hypervisor (-s option)
|
|
|
10 |
|
|
|
11 |
Sample crontab entry included. If run from crontab, using -r (Report Only) will only return a string if there is an update; something
|
|
|
12 |
added/removed/moved
|
|
|
13 |
|
|
|
14 |
All flags available by passing --help.
|
|
|
15 |
|
|
|
16 |
-s Show database
|
|
|
17 |
-c filename Use alternative database
|
|
|
18 |
-n Don't update the database
|
|
|
19 |
-v Be Verbose (show some stats)
|
|
|
20 |
-r Report - only display if something changed
|
116 |
rodolico |
21 |
|
|
|
22 |
== migrateDomain.pl
|
|
|
23 |
Does a standard migration, but does it a little different. Call with the target machine as the first parameter, followed by 1 or
|
|
|
24 |
more running virtuals to be migrated. The special keyword ALL (in all caps) attempts to migrate all virtuals sequentially after
|
|
|
25 |
prompting for authorization.
|
|
|
26 |
|
|
|
27 |
Example:
|
|
|
28 |
perl migrateDomain.pl hyper1 test.example.com
|
|
|
29 |
Verifies test.example.com is currently running here, then attempts to migrate it to machine hyper1
|
|
|
30 |
|
|
|
31 |
perl migrateDomain.pl hyper1 test.example.com 10 test2.example
|
|
|
32 |
In turn verifies the virtuals exist and are running (test.example.com, the virtual with an ID of 10, test2.example.com), then
|
|
|
33 |
migrates them to machine hyper1.
|
|
|
34 |
|
|
|
35 |
perl migrateDomain.pl hyper1 ALL
|
|
|
36 |
Requires you to enter the word 'Yes' (case insensitive), then sequentially migrates each virtual to hyper1
|
|
|
37 |
|
117 |
rodolico |
38 |
== startVirtual.pl
|
|
|
39 |
|
|
|
40 |
This will safely start a virtual by checking with findVirtuals first to see if the domain is running on another hypervisor
|