summaryrefslogtreecommitdiffstats
path: root/deploy/compass_conf/templates/ansible_installer/openstack_kilo/hosts/HA-ansible-multinodes.tmpl
blob: 9d628b5eccb95e12db03f15e5c765343636b1122 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#set ip_settings={}
#for k,v in $getVar('ip_settings', {}).items()
#set host_ip_settings={}
#for intf in v
#set $host_ip_settings[$intf["alias"]]=intf
#end for
#set $ip_settings[$k]=$host_ip_settings
#end for

# localhost
127.0.0.1 localhost
#set controllers = $getVar('controller', [])
#set computes = $getVar('compute', [])
#if not $isinstance($controllers, list)
    #set controllers = [$controllers]
#end if
#if not $isinstance($compute, list)
    #set computes = [$computes]
#end if
# controller
#for worker in $controllers
    #set worker_hostname = $worker.hostname
    #set worker_ip = $ip_settings[$worker_hostname].mgmt.ip
$worker_ip $worker_hostname
#end for
# compute
#for worker in $computes
    #set worker_hostname = $worker.hostname
    #set worker_ip = $ip_settings[$worker_hostname].mgmt.ip
$worker_ip $worker_hostname
#end for
eep 0.1 done echo "Failed in check of unix socket created by qemu-nbd" exit 1 } converted_image=$TEST_IMG.converted _export_nbd_snapshot() { _cleanup_nbd $QEMU_NBD -v -t -k "$nbd_unix_socket" "$TEST_IMG" -l $1 & _wait_for_nbd } _export_nbd_snapshot1() { _cleanup_nbd $QEMU_NBD -v -t -k "$nbd_unix_socket" "$TEST_IMG" -l snapshot.name=$1 & _wait_for_nbd } _cleanup() { _cleanup_nbd _cleanup_test_img rm -f "$converted_image" } trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common.rc . ./common.filter . ./common.pattern _supported_fmt qcow2 _supported_proto file _supported_os Linux _require_command QEMU_NBD # Internal snapshots are (currently) impossible with refcount_bits=1 _unsupported_imgopts 'refcount_bits=1[^0-9]' # Use -f raw instead of -f $IMGFMT for the NBD connection QEMU_IO_NBD="$QEMU_IO -f raw --cache=$CACHEMODE" echo echo "== preparing image ==" _make_test_img 64M $QEMU_IO -c 'write -P 0xa 0x1000 0x1000' "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c 'write -P 0xb 0x2000 0x1000' "$TEST_IMG" | _filter_qemu_io $QEMU_IMG snapshot -c sn1 "$TEST_IMG" $QEMU_IO -c 'write -P 0xc 0x1000 0x1000' "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c 'write -P 0xd 0x2000 0x1000' "$TEST_IMG" | _filter_qemu_io _check_test_img echo echo "== verifying the image file with patterns ==" $QEMU_IO -c 'read -P 0xc 0x1000 0x1000' "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c 'read -P 0xd 0x2000 0x1000' "$TEST_IMG" | _filter_qemu_io _export_nbd_snapshot sn1 echo echo "== verifying the exported snapshot with patterns, method 1 ==" $QEMU_IO_NBD -c 'read -P 0xa 0x1000 0x1000' "$nbd_snapshot_img" | _filter_qemu_io $QEMU_IO_NBD -c 'read -P 0xb 0x2000 0x1000' "$nbd_snapshot_img" | _filter_qemu_io _export_nbd_snapshot1 sn1 echo echo "== verifying the exported snapshot with patterns, method 2 ==" $QEMU_IO_NBD -c 'read -P 0xa 0x1000 0x1000' "$nbd_snapshot_img" | _filter_qemu_io $QEMU_IO_NBD -c 'read -P 0xb 0x2000 0x1000' "$nbd_snapshot_img" | _filter_qemu_io $QEMU_IMG convert "$TEST_IMG" -l sn1 -O qcow2 "$converted_image" echo echo "== verifying the converted snapshot with patterns, method 1 ==" $QEMU_IO -c 'read -P 0xa 0x1000 0x1000' "$converted_image" | _filter_qemu_io $QEMU_IO -c 'read -P 0xb 0x2000 0x1000' "$converted_image" | _filter_qemu_io $QEMU_IMG convert "$TEST_IMG" -l snapshot.name=sn1 -O qcow2 "$converted_image" echo echo "== verifying the converted snapshot with patterns, method 2 ==" $QEMU_IO -c 'read -P 0xa 0x1000 0x1000' "$converted_image" | _filter_qemu_io $QEMU_IO -c 'read -P 0xb 0x2000 0x1000' "$converted_image" | _filter_qemu_io # success, all done echo "*** done" rm -f $seq.full status=0