238 The Virtualization Cookbook for Red Hat Enterprise Linux 5.2
echo "Cloning $master_linux_id to $cloned_linux_id ..."
[ -z "$DASD" ] && echo "Error: no DASD defined in /etc/clone/${cloned_linux_id}.conf" &&
exit
copy_disks $DASD
# Update the newly cloned image locally, so link, set online then mount the
# clone's root filesystem. Then call modify_cloned_image to update
# configuration files with the proper settings. Finally unmount,
# set offline and unlink the disk.
echo "Updating cloned image ..."
if [ -n "$VG_NAME" ]; then
link_disks $DASD
# FIXME wait for disks
sleep 2
/sbin/vgscan
# FIXME wait for vgscan
sleep 2
/sbin/vgchange -a y $VG_NAME
mount_cloned_image_lvm $CLONE_LINK
else
link_one $cloned_linux_id $DASD_ROOT $CLONE_LINK W
set_online $CLONE_LINK
mount_cloned_image $CLONE_LINK
fi
modify_cloned_image
umount_cloned_image
if [ -n "$VG_NAME" ]; then
/sbin/vgchange -a n $VG_NAME
unlink_disks $DASD
else
set_offline $CLONE_LINK
unlink_one $CLONE_LINK
fi
# Autolog the clone unless AUTOLOG has been set to "n"
[ "$AUTOLOG" = "y" ] && autolog
echo "Successfully cloned $master_linux_id to $cloned_linux_id"
Comentarios a estos manuales