Revision 1266a29b
b/tools/vcluster-setup.in | ||
---|---|---|
41 | 41 |
readonly max_instance_count=$((255 - first_inst_ipaddr_octet)) |
42 | 42 |
|
43 | 43 |
usage() { |
44 |
echo "Usage: $0 [-c <number>] [-i <number>] [-p <prefix>] [-n <netdev>]"\
|
|
45 |
'<directory>' |
|
44 |
echo "Usage: $0 [-E] [-N] [-c <number>] [-i <number>] [-p <prefix>]"\
|
|
45 |
'[-n <netdev>] <directory>'
|
|
46 | 46 |
echo |
47 | 47 |
echo 'Options:' |
48 | 48 |
echo " -c Number of virtual nodes (defaults to $default_nodecount)" |
... | ... | |
50 | 50 |
echo " -p IPv4 network prefix (defaults to $default_netprefix)" |
51 | 51 |
echo ' -n Network device for virtual IP addresses (defaults to'\ |
52 | 52 |
"$default_netdev)" |
53 |
echo ' -E Do not modify /etc/hosts' |
|
54 |
echo ' -N Do not configure networking' |
|
53 | 55 |
} |
54 | 56 |
|
55 | 57 |
# Variables for options |
... | ... | |
57 | 59 |
instcount=$default_instcount |
58 | 60 |
netprefix=$default_netprefix |
59 | 61 |
netdev=$default_netdev |
62 |
etchosts=1 |
|
63 |
networking=1 |
|
60 | 64 |
|
61 | 65 |
# Parse options |
62 |
while getopts :hc:p:n:i: opt; do |
|
66 |
while getopts :hENc:p:n:i: opt; do
|
|
63 | 67 |
case "$opt" in |
64 | 68 |
h) |
65 | 69 |
usage |
... | ... | |
99 | 103 |
exit 1 |
100 | 104 |
fi |
101 | 105 |
;; |
106 |
E) |
|
107 |
etchosts= |
|
108 |
;; |
|
109 |
N) |
|
110 |
networking= |
|
111 |
;; |
|
102 | 112 |
\?) |
103 | 113 |
echo "Invalid option: -$OPTARG" >&2 |
104 | 114 |
usage >&2 |
... | ... | |
166 | 176 |
fi |
167 | 177 |
|
168 | 178 |
mkdir -p \ |
169 |
$nodedir/etc/default \
|
|
170 |
$nodedir/var/lock\
|
|
171 |
$nodedir/var/{lib,log,run}/ganeti
|
|
179 |
$nodedir@SYSCONFDIR@/default \
|
|
180 |
$nodedir@LOCALSTATEDIR@/lock\
|
|
181 |
$nodedir@LOCALSTATEDIR@/{lib,log,run}/ganeti
|
|
172 | 182 |
|
173 | 183 |
GANETI_HOSTNAME=$(node_hostname $number) \ |
174 | 184 |
GANETI_ROOTDIR=$nodedir \ |
... | ... | |
263 | 273 |
cat <<EOF |
264 | 274 |
|
265 | 275 |
Initialize cluster: |
266 |
cd $rootdir && node1/cmd gnt-cluster init --no-etc-hosts $cluster_name |
|
276 |
cd $rootdir && node1/cmd gnt-cluster init --no-etc-hosts \\ |
|
277 |
--no-ssh-init --no-lvm-storage --no-drbd-storage $cluster_name |
|
267 | 278 |
|
268 | 279 |
Change cluster settings: |
269 | 280 |
cd $rootdir && node1/cmd gnt-cluster modify \\ |
270 |
--enabled-hypervisors=fake \\ |
|
281 |
--enabled-hypervisors=fake --specs-nic-count=min=0 \\
|
|
271 | 282 |
--specs-disk-size=min=0 --specs-disk-count=min=0 |
272 | 283 |
|
273 | 284 |
Add node: |
... | ... | |
276 | 287 |
} |
277 | 288 |
|
278 | 289 |
setup_all_nodes |
279 |
setup_etc_hosts |
|
280 |
setup_network_interfaces |
|
290 |
if [[ -n "$etchosts" ]]; then |
|
291 |
setup_etc_hosts |
|
292 |
fi |
|
293 |
if [[ -n "$networking" ]]; then |
|
294 |
setup_network_interfaces |
|
295 |
fi |
|
281 | 296 |
setup_scripts |
282 | 297 |
show_info |
283 | 298 |
|
Also available in: Unified diff