[Ovirt-devel] [PATCH node-image] Fix create-ovirt-iso-nodes to allow manual specification of network bridge to use
Perry Myers
pmyers at redhat.com
Sun Jul 5 17:46:36 UTC 2009
Since create-ovirt-network script has been deprecated (was part of
ovirt-appliance repo) we can't default to bridge on the host of ovirtbr0 for
doing fake node testing. So default to network:default and allow manual override
to something like bridge:breth0
Signed-off-by: Perry Myers <pmyers at redhat.com>
---
create-ovirt-iso-nodes | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/create-ovirt-iso-nodes b/create-ovirt-iso-nodes
index d74dc4d..fe2e7ab 100755
--- a/create-ovirt-iso-nodes
+++ b/create-ovirt-iso-nodes
@@ -24,7 +24,7 @@ warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
try_h() { printf "Try \`$ME -h' for more information.\n" >&2; }
die() { warn "$@"; try_h; exit 1; }
-BRIDGENAME=ovirtbr0
+NET_DEFAULT=network:default
IMGDIR_DEFAULT=/var/lib/libvirt/images
imgdir=$IMGDIR_DEFAULT
NODEIMG_DEFAULT=/usr/share/ovirt-node-image/ovirt-node-image.iso
@@ -66,7 +66,7 @@ gen_fake_managed_node() {
# that just defines the VM w/o starting it.
virt-install --name=node$num --ram=$ram --vcpus=$vcpus $disks \
--cdrom=$dest_nodeimg --livecd \
- --network=bridge:$BRIDGENAME --mac=00:16:3e:12:34:$last_mac \
+ --network=$net --mac=00:16:3e:12:34:$last_mac \
--vnc --accelerate --hvm --noautoconsole \
--os-type=linux --os-variant=$os_variant \
--force --noreboot
@@ -78,8 +78,9 @@ usage() {
case $# in 1) warn "$1"; try_h; exit 1;; esac
cat <<EOF
Usage: $ME [-d image_dir] [-n node.iso] [-c num_disks] [-s start-stop]
- [-v vcpus] [-r ram] [-x]
+ [-v vcpus] [-r ram] [-x] [-b network]
-n: node.iso to boot (default: $NODEIMG_DEFAULT)
+ -b: network name (default: $NET_DEFAULT)
-d: directory to place virtual disk (default: $IMGDIR_DEFAULT)
-c: number of disks per fake node (default: $NUM_DISKS_DEFAULT)
-s: node range (default: $RANGE_DEFAULT)
@@ -96,10 +97,12 @@ num_disks=$NUM_DISKS_DEFAULT
range=$RANGE_DEFAULT
ram=$RAM_DEFAULT
vcpus=$VCPUS_DEFAULT
-while getopts :d:n:s:c:v:r:xh c; do
+net=$NET_DEFAULT
+while getopts :d:n:b:s:c:v:r:xh c; do
case $c in
n) nodeimg=$OPTARG;;
d) imgdir=$OPTARG;;
+ b) net=$OPTARG;;
c) num_disks=$OPTARG;;
s) range=$OPTARG;;
v) vcpus=$OPTARG;;
--
1.6.2.5
More information about the ovirt-devel
mailing list