24 |
rodolico |
1 |
=== Overview
|
14 |
rodolico |
2 |
|
24 |
rodolico |
3 |
Basic
|
14 |
rodolico |
4 |
|
24 |
rodolico |
5 |
havirt [command [action]] [flags]
|
14 |
rodolico |
6 |
|
24 |
rodolico |
7 |
command is actually a module name, action is a function (sub) within the
|
|
|
8 |
module, and flags can be placed anywhere, Thus,
|
|
|
9 |
|
|
|
10 |
havirt domain list
|
|
|
11 |
|
25 |
rodolico |
12 |
loads the domain module and runs the list function. To send the output to
|
|
|
13 |
a tab separated value, you can use the -f flag, so the following are
|
|
|
14 |
equivilent
|
24 |
rodolico |
15 |
|
25 |
rodolico |
16 |
havirt -f tsv domain list
|
|
|
17 |
havirt domain list -f tsv
|
|
|
18 |
havirt domain -f tsv list
|
|
|
19 |
|
41 |
rodolico |
20 |
To add a new virtual (currently running)
|
|
|
21 |
|
|
|
22 |
havirt node scan --force [node] # find new domain
|
|
|
23 |
havirt domain update [domainname]
|
|
|
24 |
|
|
|
25 |
If you do not include a node in the first command, all nodes will be
|
|
|
26 |
scanned. If you do not include the domainname in the second command, all domains
|
|
|
27 |
defined will be updated.
|
|
|
28 |
|
25 |
rodolico |
29 |
Base modules are:
|
|
|
30 |
|
24 |
rodolico |
31 |
- **domain**: Work with individual virtual servers, called domains under virtlib
|
|
|
32 |
- **node**: Work with hypervisors, called nodes under virtlib
|
|
|
33 |
- **cluster**: Work with the entire cluster of hypervisors
|
|
|
34 |
|
|
|
35 |
Each command has a help parameter which is called if no action is passed (or the action is
|
|
|
36 |
help). The commands *havirt node* and *havirt node help* are equivilent
|
|
|
37 |
|
14 |
rodolico |
38 |
=== domain.pm module commands
|
|
|
39 |
|
24 |
rodolico |
40 |
==== update [domainname|-t domainname]
|
14 |
rodolico |
41 |
updates capabilities on one or more domains by reading and parsing the files
|
|
|
42 |
stored in conf/ and updating var/status.yaml
|
|
|
43 |
default is to rescan all domains
|
|
|
44 |
|
24 |
rodolico |
45 |
==== list [--format|-f screen|tsv]
|
14 |
rodolico |
46 |
Displays all domains with some statistics about them as screen or tsv
|
|
|
47 |
default is to display to fixed width for screen display
|
|
|
48 |
|
24 |
rodolico |
49 |
==== start domainname [node]
|
14 |
rodolico |
50 |
Checks to ensure domain not running on any node, and starts domainname on
|
|
|
51 |
requested node. Displays an error message if domain configuration not
|
|
|
52 |
found, or the domain is found to be running somewhere in the cluster.
|
|
|
53 |
Verifies domain not running by rescanning all nodes
|
|
|
54 |
If node not set, will start on the current node (one which user logged into).
|
|
|
55 |
|
24 |
rodolico |
56 |
==== shutdown domainname
|
14 |
rodolico |
57 |
Initiates a shutdown on a running domain and sets "maintenance" flag so
|
|
|
58 |
keepalive will not restart it
|
|
|
59 |
|
24 |
rodolico |
60 |
==== migrate domainname [node]
|
14 |
rodolico |
61 |
migrates domain from current node to target. If target node not specified
|
|
|
62 |
will be automatically selected with least used node
|
|
|
63 |
|
24 |
rodolico |
64 |
==== new [domainname]
|
14 |
rodolico |
65 |
Displays a virt-install command that will fill in several blanks such as
|
|
|
66 |
an unused VNC port, a newly generated UUID and a randomly generated
|
|
|
67 |
MAC address. If domainname is passed in, will insert that also.
|
|
|
68 |
|
|
|
69 |
Uses the file virt-install.template in the havirt directory
|
|
|
70 |
|
|
|
71 |
WARNING: MAC address randomly generated with prefix of '00163e' (assigned
|
|
|
72 |
to XEN) and is not guaranteed to be unique in cluster at this time.
|
|
|
73 |
|
|
|
74 |
|
|
|
75 |
=== node.pm module commands
|
|
|
76 |
|
24 |
rodolico |
77 |
==== update [nodename|-t nodename]
|
14 |
rodolico |
78 |
Updates capabilities on one or more nodes. If node is not currently in
|
|
|
79 |
database, will be added
|
|
|
80 |
default is all nodes
|
|
|
81 |
|
24 |
rodolico |
82 |
==== add - convenience alias for update
|
14 |
rodolico |
83 |
|
24 |
rodolico |
84 |
==== list [--format|-f screen|tsv]
|
14 |
rodolico |
85 |
Lists all nodes with some statistics about them as screen or tsv (default
|
|
|
86 |
screen)
|
|
|
87 |
|
24 |
rodolico |
88 |
==== scan [nodename|-t nodename][-y]
|
14 |
rodolico |
89 |
Updates list of domains on one or more existing nodes
|
|
|
90 |
This should be run regularly via a cron job to keep the database up to
|
|
|
91 |
date.
|
|
|
92 |
Will NOT scan if the most recent scan has taken place less thn 5 minutes
|
|
|
93 |
ago, determined by timestamp on file 'lastscan'). To force a new scan
|
|
|
94 |
pass the -y flag, or delete lastscan
|
|
|
95 |
default is scan all nodes
|
|
|
96 |
|
|
|
97 |
|
|
|
98 |
|
|
|
99 |
=== cluster.pm module
|
|
|
100 |
|
24 |
rodolico |
101 |
==== status [--format|-f screen|tsv]
|
14 |
rodolico |
102 |
displays some stats on resources used on each node
|