1
0
mirror of synced 2026-01-24 02:57:32 +00:00

2006-02-17 07:30:27 by steve

Made the creation of the Xen configuration file simpler with regards to
 disk images.
This commit is contained in:
steve 2006-02-17 07:30:27 +00:00
parent 50131b98b6
commit f29c2dae87

View File

@ -351,7 +351,7 @@ Install an X11 server, using VNC and XDM
--
http://www.steve.org.uk/
$Id: xen-create-image,v 1.92 2006-02-16 19:24:38 steve Exp $
$Id: xen-create-image,v 1.93 2006-02-17 07:30:27 steve Exp $
=cut
@ -561,19 +561,39 @@ print "\n";
#
# The two images we'll use, one for the disk image, one for swap.
#
my $image;
my $swap;
my $image = "";
my $swap = "";
my $image_vbd = "";
my $swap_vbd = "";
if ( $CONFIG{'volume'} )
{
#
# Images upon the LVM system.
#
$image = "/dev/" . $CONFIG{'volume'} . "/" . $CONFIG{'hostname'} . '-root';
$swap = "/dev/" . $CONFIG{'volume'} . "/" . $CONFIG{'hostname'} . '-swap';
#
# Images as presented to Xen.
#
$image_vbd = "phy:${CONFIG{'volume'}}/${CONFIG{'hostname'}}-root";
$swap_vbd = "phy:${CONFIG{'volume'}}/${CONFIG{'hostname'}}-swap";
}
elsif ( $CONFIG{'dir'} )
{
#
# Images upon the filesystem.
#
$image = $CONFIG{'dir'} . '/domains/' . $CONFIG{'hostname'} . "/disk.img" ;
$swap = $CONFIG{'dir'} . '/domains/' . $CONFIG{'hostname'} . "/swap.img" ;
#
# Images as presented to Xen.
#
$image_vbd = "file:" . $image;
$swap_vbd = "file:" . $swap;
}
else
{
@ -760,14 +780,8 @@ memory = $CONFIG{'memory'}
name = "$CONFIG{'hostname'}"
root = "/dev/sda1 ro"
vif = ['']
disk = [ '${image_vbd},sda1,w', '${swap_vbd},sda2,w' ]
E_O_XEN
if ( $CONFIG{'dir'} )
{
print XEN "disk = [ 'file:$image,sda1,w','file:$swap,sda2,w' ]\n";
}
if ( $CONFIG{'volume'} )
{
print XEN "disk = [ 'phy:$CONFIG{'volume'}/$CONFIG{'hostname'}-root{,sda1,w','phy:$CONFIG{'volume'}/$CONFIG{'hostname'}-swap,sda2,w' ]\n";
}
if ( $CONFIG{'dhcp'} )
{
@ -960,7 +974,7 @@ sub parseCommandLineArguments
if ( $VERSION )
{
my $REVISION = '$Revision: 1.92 $';
my $REVISION = '$Revision: 1.93 $';
if ( $REVISION =~ /1.([0-9.]+) / )
{