Added support for (optionally) setting the bridge
--bridge Added support for setting the number of vcpus --vcpus
This commit is contained in:
@@ -137,6 +137,10 @@ xen-create-image - Easily create new Xen instances with networking and OpenSSH.
|
||||
Install a getty on the specified serial device instead
|
||||
of the default device.
|
||||
|
||||
--vcpus=num
|
||||
Set the number of vcpus that the new instance will have
|
||||
instead of the default value of "1".
|
||||
|
||||
|
||||
Installation options:
|
||||
|
||||
@@ -202,6 +206,10 @@ xen-create-image - Easily create new Xen instances with networking and OpenSSH.
|
||||
--broadcast=123.456.789.ABC
|
||||
Setup the broadcast address for the new instance.
|
||||
|
||||
--bridge=brname
|
||||
Optionally, set a specific bridge for the new instance.
|
||||
This can be especially useful when running multiple
|
||||
bridges on a machine.
|
||||
|
||||
|
||||
Mandatory options:
|
||||
@@ -1225,6 +1233,7 @@ sub setupDefaultOptions
|
||||
$CONFIG{ 'swap' } = '128M';
|
||||
$CONFIG{ 'cache' } = 'yes';
|
||||
$CONFIG{ 'image' } = 'sparse';
|
||||
$CONFIG{ 'vcpus' } = '1';
|
||||
|
||||
#
|
||||
# Misc. options.
|
||||
@@ -1421,6 +1430,7 @@ sub parseCommandLineArguments
|
||||
"noswap", \$CONFIG{ 'noswap' },
|
||||
"image=s", \$CONFIG{ 'image' },
|
||||
"memory=s", \$CONFIG{ 'memory' },
|
||||
"vcpus=s", \$CONFIG{ 'vcpus' },
|
||||
|
||||
# Locations
|
||||
"dir=s", \$install{ 'dir' },
|
||||
@@ -1441,6 +1451,7 @@ sub parseCommandLineArguments
|
||||
|
||||
# Networking options
|
||||
"dhcp", \$CONFIG{ 'dhcp' },
|
||||
"bridge=s", \$CONFIG{ 'bridge' },
|
||||
"gateway=s", \$CONFIG{ 'gateway' },
|
||||
"hostname=s", \$CONFIG{ 'hostname' },
|
||||
"ip=s@", \$CONFIG{ 'ip' },
|
||||
|
||||
26
etc/xm.tmpl
26
etc/xm.tmpl
@@ -34,6 +34,7 @@
|
||||
$OUT .= "bootloader = '$pygrub_bin'\n";
|
||||
}
|
||||
}
|
||||
vcpus = '{$vcpus}'
|
||||
memory = '{$memory}'
|
||||
|
||||
#
|
||||
@@ -106,8 +107,22 @@ name = '{$hostname}'
|
||||
{
|
||||
$m = "mac=$mac"
|
||||
}
|
||||
|
||||
$OUT .= "vif = [ '$m' ]";
|
||||
my $br = '';
|
||||
if ( $bridge )
|
||||
{
|
||||
if ( $mac )
|
||||
{
|
||||
$br = ",bridge=$bridge"
|
||||
}
|
||||
else
|
||||
{
|
||||
$br = "bridge=$bridge"
|
||||
}
|
||||
}
|
||||
$OUT .= "vif = [ '";
|
||||
$OUT .= "$m";
|
||||
$OUT .= "$br";
|
||||
$OUT .= "' ]";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -126,9 +141,16 @@ name = '{$hostname}'
|
||||
$vn = ",vifname=$vifname";
|
||||
}
|
||||
|
||||
my $br = '';
|
||||
if ( $bridge )
|
||||
{
|
||||
$br = ",bridge=$bridge"
|
||||
}
|
||||
|
||||
$OUT .= "vif = [ 'ip=$ip1";
|
||||
$OUT .= "$m";
|
||||
$OUT .= "$vn";
|
||||
$OUT .= "$br";
|
||||
$OUT .= "' ]";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user