diff options
author | Martin Schwenke <martin@meltin.net> | 2014-06-19 11:33:32 +1000 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2014-06-25 20:46:16 +1000 |
commit | 1a9a57d2c57c49b48564e99d293f840b51a19ff0 (patch) | |
tree | 19184286ebbb18595dcf77b5d01be2f097e7d3a2 /config.d | |
parent | 0852b535992942770e5adbb40ce78eaaf70a912b (diff) | |
download | autocluster-1a9a57d2c57c49b48564e99d293f840b51a19ff0.tar.gz autocluster-1a9a57d2c57c49b48564e99d293f840b51a19ff0.tar.xz autocluster-1a9a57d2c57c49b48564e99d293f840b51a19ff0.zip |
Add shared disk ID as serial number in shared disk XML
Hedge bets by continuing to write the ID to the image file.
While touching this code, add the cluster name to the temporary
filename for the shared disk ID map. Setting $shared_disk_ids needs
to move to shared_disk_setup() so $CLUSTER can be used. Also need to
update this path in mknsd.sh.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'config.d')
-rw-r--r-- | config.d/10shareddisk.defconf | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/config.d/10shareddisk.defconf b/config.d/10shareddisk.defconf index 0e3119a..ed21f9c 100644 --- a/config.d/10shareddisk.defconf +++ b/config.d/10shareddisk.defconf @@ -78,6 +78,7 @@ shared_disk_template () for SHARED_DISK_NUM in $(seq 1 $SHAREDDISK_COUNT) ; do local DISK="${VIRTBASE}/${CLUSTER}/shared${SHARED_DISK_NUM}" run_hooks hack_disk_hooks "shared" + local serial=$(sed -n "${SHARED_DISK_NUM}p" "$shared_disk_ids") for p in $(seq 1 $paths) ; do local dev="${devices[$n]}" [ -n "$dev" ] || die "Too many shared disks! The function shared_disk_template needs to be hacked to allow more shared disks..." @@ -86,6 +87,7 @@ shared_disk_template () <driver name='qemu' cache='@@SHARED_DISK_CACHE@@'/> <source file='${DISK}'/> <target dev='@@SHARED_DISK_PREFIX@@${dev}' bus='@@SHARED_DISK_TYPE@@'/> + <serial>${serial}</serial> <shareable/> </disk> EOF @@ -105,12 +107,11 @@ shared_disk_post_config_hook() register_hook post_config_hooks shared_disk_post_config_hook -shared_disk_ids="tmp/shared_disk_ids" - register_hook create_cluster_hooks shared_disk_setup shared_disk_setup () { + shared_disk_ids="tmp/shared_disk_ids.${CLUSTER}" rm -f "$shared_disk_ids" if [ -n "$SHAREDDISKSIZE" -a -n "$SHAREDDISK_TEMPLATE" -a \ |