Subversion Repositories sysadmin_scripts

Rev

Rev 113 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 113 Rev 116
Line 1... Line 1...
1
Set of Perl scripts to help manage virtuals
1
Set of Perl scripts to help manage virtuals
2
 
2
 
3
ParseXenConfigs.pl
3
== ParseXenConfigs.pl
4
Just goes through all Xen config files and pulls information. Currently only looks for MAC address and checks for duplicates
4
Just goes through all Xen config files and pulls information. Currently only looks for MAC address and checks for duplicates
5
 
5
 
6
findVirtuals.pl
6
== findVirtuals.pl
7
Designed to be put on shared storage on several hypervisors and run via cron. Determines which virtual is running on which 
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
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)
9
of which virtual is running on which hypervisor (-s option)
10
 
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
11
Sample crontab entry included. If run from crontab, using -r (Report Only) will only return a string if there is an update; something
Line 16... Line 16...
16
-s          Show database
16
-s          Show database
17
-c filename Use alternative database
17
-c filename Use alternative database
18
-n          Don't update the database
18
-n          Don't update the database
19
-v          Be Verbose (show some stats)
19
-v          Be Verbose (show some stats)
20
-r          Report - only display if something changed
20
-r          Report - only display if something changed
-
 
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