ia64/xen-unstable

changeset 1987:cfbc2a2c3fea

bitkeeper revision 1.1108.35.4 (41090ec8uR9vt6nVJD7Yw0OJlfO1Hw)

Rename the xm defaults for linux and netbsd, replace with a simpler
default config that doesn't use parameters.
author mjw@wray-m-3.hpl.hp.com
date Thu Jul 29 14:50:48 2004 +0000 (2004-07-29)
parents 7fdc6f3e894c
children 84b9fcf01e7f
files .rootkeys tools/examples/xmdefaults tools/examples/xmexample tools/examples/xmnetbsd tools/examples/xmnetbsd-example
line diff
     1.1 --- a/.rootkeys	Thu Jul 29 14:15:38 2004 +0000
     1.2 +++ b/.rootkeys	Thu Jul 29 14:50:48 2004 +0000
     1.3 @@ -266,8 +266,9 @@ 40ee75a9xFz6S05sDKu-JCLqyVTkDA tools/exa
     1.4  40ee75a967sxgcRY4Q7zXoVUaJ4flA tools/examples/vif-bridge
     1.5  40e15b7edWEtBf_oe3eBwGKuh1dyzQ tools/examples/vifctl
     1.6  40ee75a93cqxHp6MiYXxxwR5j2_8QQ tools/examples/xend-config.sxp
     1.7 -40cf2937oKlROYOJTN8GWwWM5AmjBg tools/examples/xmdefaults
     1.8 -40dfd40auJwNnb8NoiSnRkvZaaXkUg tools/examples/xmnetbsd
     1.9 +41090ec8Pj_bkgCBpg2W7WfmNkumEA tools/examples/xmdefaults
    1.10 +40cf2937oKlROYOJTN8GWwWM5AmjBg tools/examples/xmexample
    1.11 +40dfd40auJwNnb8NoiSnRkvZaaXkUg tools/examples/xmnetbsd-example
    1.12  3fbba6dbDfYvJSsw9500b4SZyUhxjQ tools/libxc/Makefile
    1.13  3fbba6dc1uU7U3IFeF6A-XEOYF2MkQ tools/libxc/rpm.spec
    1.14  3fbba6dcrNxtygEcgJYAJJ1gCQqfsA tools/libxc/xc.h
     2.1 --- a/tools/examples/xmdefaults	Thu Jul 29 14:15:38 2004 +0000
     2.2 +++ b/tools/examples/xmdefaults	Thu Jul 29 14:50:48 2004 +0000
     2.3 @@ -1,28 +1,14 @@
     2.4  #  -*- mode: python; -*-
     2.5  #============================================================================
     2.6  # Python defaults setup for 'xm create'.
     2.7 -# Edit this file to reflect the configuration of your system.
     2.8 +# This script sets the parameters used when a domain is created using 'xm create'.
     2.9 +# You use a separate script for each domain you want to create, or 
    2.10 +# you can set the parameters for the domain on the xm command line.
    2.11  #============================================================================
    2.12  
    2.13 -# Define script variables here.
    2.14 -# xm_vars is defined automatically, use xm_vars.var() to define a variable.
    2.15 -
    2.16 -def vmid_check(var, val):
    2.17 -    val = int(val)
    2.18 -    if val <= 0:
    2.19 -        raise ValueError
    2.20 -    return val
    2.21 -    
    2.22 -xm_vars.var('vmid',
    2.23 -            use="Virtual machine id. Integer greater than 0.",
    2.24 -            check=vmid_check)
    2.25 -
    2.26 -# This checks the script variables.
    2.27 -xm_vars.check()
    2.28 -
    2.29  #----------------------------------------------------------------------------
    2.30  # Kernel image file.
    2.31 -kernel = "../../../install/boot/vmlinuz-2.4.26-xenU"
    2.32 +kernel = "/boot/vmlinuz-2.4.26-xenU"
    2.33  
    2.34  # Optional ramdisk.
    2.35  #ramdisk = "/boot/initrd.gz"
    2.36 @@ -34,12 +20,11 @@ kernel = "../../../install/boot/vmlinuz-
    2.37  # Initial memory allocation (in megabytes) for the new domain.
    2.38  memory = 64
    2.39  
    2.40 -# A handy name for your new domain.
    2.41 -name = "This is VM %d" % vmid
    2.42 +# A name for your domain. All domains must have different names.
    2.43 +name = "ExampleDomain"
    2.44  
    2.45  # Which CPU to start domain on? 
    2.46  #cpu = -1   # leave to Xen to pick
    2.47 -cpu = vmid  # set based on vmid (mod number of CPUs)
    2.48  
    2.49  #----------------------------------------------------------------------------
    2.50  # Define network interfaces.
    2.51 @@ -54,12 +39,11 @@ cpu = vmid  # set based on vmid (mod num
    2.52  #----------------------------------------------------------------------------
    2.53  # Define the disk devices you want the domain to have access to, and
    2.54  # what you want them accessible as.
    2.55 -# Each disk entry is of the form phy:DEV,VDEV,MODE
    2.56 -# where DEV is the device, VDEV is the device name the domain will see,
    2.57 +# Each disk entry is of the form phy:UNAME,DEV,MODE
    2.58 +# where UNAME is the device, DEV is the device name the domain will see,
    2.59  # and MODE is r for read-only, w for read-write.
    2.60  
    2.61 -disk = [ 'phy:sda%d,sda1,w' % (7+vmid),
    2.62 -         'phy:sda6,sda6,r' ]
    2.63 +disk = [ 'phy:hda1,xda1,r' ]
    2.64  
    2.65  #----------------------------------------------------------------------------
    2.66  # Set the kernel command line for the new domain.
    2.67 @@ -78,7 +62,7 @@ disk = [ 'phy:sda%d,sda1,w' % (7+vmid),
    2.68  #hostname= "vm%d" % vmid
    2.69  
    2.70  # Set root device.
    2.71 -root = "/dev/sda1 ro"
    2.72 +root = "/dev/xda1 ro"
    2.73  
    2.74  # Root device for nfs.
    2.75  #root = "/dev/nfs"
    2.76 @@ -87,8 +71,8 @@ root = "/dev/sda1 ro"
    2.77  # Root directory on the nfs server.
    2.78  #nfs_root   = '/full/path/to/root/directory'
    2.79  
    2.80 -# Sets runlevel 4 and the device for /usr.
    2.81 -extra = "4 VMID=%d usr=/dev/sda6" % vmid
    2.82 +# Sets runlevel 4.
    2.83 +extra = "4"
    2.84  
    2.85  #----------------------------------------------------------------------------
    2.86  # Set according to whether you want the domain restarted when it exits.
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/tools/examples/xmexample	Thu Jul 29 14:50:48 2004 +0000
     3.3 @@ -0,0 +1,120 @@
     3.4 +#  -*- mode: python; -*-
     3.5 +#============================================================================
     3.6 +# Example Python setup script for 'xm create'.
     3.7 +# This script sets the parameters used when a domain is created using 'xm create'.
     3.8 +#
     3.9 +# This is a relatively advanced script that uses a parameter, vmid, to control
    3.10 +# the settings. So this script can be used to start a set of domains by
    3.11 +# setting the vmid parameter on the 'xm create' command line. For example:
    3.12 +#
    3.13 +# xm create vmid=1
    3.14 +# xm create vmid=2
    3.15 +# xm create vmid=3
    3.16 +#
    3.17 +# The vmid is purely a script variable, and has no effect on the the domain
    3.18 +# id assigned to the new domain.
    3.19 +#============================================================================
    3.20 +
    3.21 +# Define script variables here.
    3.22 +# xm_vars is defined automatically, use xm_vars.var() to define a variable.
    3.23 +
    3.24 +# This function checks that 'vmid' has been given a valid value.
    3.25 +# It is called automatically by 'xm create'.
    3.26 +def vmid_check(var, val):
    3.27 +    val = int(val)
    3.28 +    if val <= 0:
    3.29 +        raise ValueError
    3.30 +    return val
    3.31 +
    3.32 +# Define the 'vmid' variable so that 'xm create' knows about it.
    3.33 +xm_vars.var('vmid',
    3.34 +            use="Virtual machine id. Integer greater than 0.",
    3.35 +            check=vmid_check)
    3.36 +
    3.37 +# Check the defined variables have valid values..
    3.38 +xm_vars.check()
    3.39 +
    3.40 +#----------------------------------------------------------------------------
    3.41 +# Kernel image file.
    3.42 +kernel = "/boot/vmlinuz-2.4.26-xenU"
    3.43 +
    3.44 +# Optional ramdisk.
    3.45 +#ramdisk = "/boot/initrd.gz"
    3.46 +
    3.47 +# The domain build function. Default is 'linux'.
    3.48 +#builder='linux'
    3.49 +#builder='netbsd'
    3.50 +
    3.51 +# Initial memory allocation (in megabytes) for the new domain.
    3.52 +memory = 64
    3.53 +
    3.54 +# A name for the new domain. All domains have to have different names,
    3.55 +# so we use the vmid to create a name.
    3.56 +name = "VM%d" % vmid
    3.57 +
    3.58 +# Which CPU to start domain on? 
    3.59 +#cpu = -1   # leave to Xen to pick
    3.60 +cpu = vmid  # set based on vmid (mod number of CPUs)
    3.61 +
    3.62 +#----------------------------------------------------------------------------
    3.63 +# Define network interfaces.
    3.64 +
    3.65 +# Number of network interfaces. Default is 1.
    3.66 +#nics=1
    3.67 +
    3.68 +# Optionally define mac and/or bridge for the network interfaces.
    3.69 +# Random MACs are assigned if not given.
    3.70 +#vif = [ 'mac=aa:00:00:00:00:11, bridge=xen-br0' ]
    3.71 +
    3.72 +#----------------------------------------------------------------------------
    3.73 +# Define the disk devices you want the domain to have access to, and
    3.74 +# what you want them accessible as.
    3.75 +# Each disk entry is of the form phy:UNAME,DEV,MODE
    3.76 +# where UNAME is the device, DEV is the device name the domain will see,
    3.77 +# and MODE is r for read-only, w for read-write.
    3.78 +
    3.79 +# This makes the disk device depend on the vmid - assuming
    3.80 +# that devices sda7, sda8 etc. exist. The device is exported
    3.81 +# to all domains as sda1.
    3.82 +# All domains get sda6 read-only (to use for /usr, see below).
    3.83 +disk = [ 'phy:sda%d,sda1,w' % (7+vmid),
    3.84 +         'phy:sda6,sda6,r' ]
    3.85 +
    3.86 +#----------------------------------------------------------------------------
    3.87 +# Set the kernel command line for the new domain.
    3.88 +# You only need to define the IP parameters and hostname if the domain's
    3.89 +# IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
    3.90 +# You can use 'extra' to set the runlevel and custom environment
    3.91 +# variables used by custom rc scripts (e.g. VMID=, usr= ).
    3.92 +
    3.93 +# Set if you want dhcp to allocate the IP address.
    3.94 +#dhcp="dhcp"
    3.95 +# Set netmask.
    3.96 +#netmask=
    3.97 +# Set default gateway.
    3.98 +#gateway=
    3.99 +# Set the hostname.
   3.100 +#hostname= "vm%d" % vmid
   3.101 +
   3.102 +# Set root device.
   3.103 +root = "/dev/sda1 ro"
   3.104 +
   3.105 +# Root device for nfs.
   3.106 +#root = "/dev/nfs"
   3.107 +# The nfs server.
   3.108 +#nfs_server = '169.254.1.0'  
   3.109 +# Root directory on the nfs server.
   3.110 +#nfs_root   = '/full/path/to/root/directory'
   3.111 +
   3.112 +# Sets runlevel 4 and the device for /usr.
   3.113 +extra = "4 VMID=%d usr=/dev/sda6" % vmid
   3.114 +
   3.115 +#----------------------------------------------------------------------------
   3.116 +# Set according to whether you want the domain restarted when it exits.
   3.117 +# The default is 'onreboot', which restarts the domain when it shuts down
   3.118 +# with exit code reboot.
   3.119 +# Other values are 'always', and 'never'.
   3.120 +
   3.121 +#restart = 'onreboot'
   3.122 +
   3.123 +#============================================================================
     4.1 --- a/tools/examples/xmnetbsd	Thu Jul 29 14:15:38 2004 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,103 +0,0 @@
     4.4 -#  -*- mode: python; -*-
     4.5 -#============================================================================
     4.6 -# Python defaults setup for 'xm create'.
     4.7 -# Edit this file to reflect the configuration of your system.
     4.8 -#============================================================================
     4.9 -
    4.10 -# Define script variables here.
    4.11 -# xm_vars is defined automatically, use xm_vars.var() to define a variable.
    4.12 -
    4.13 -def vmid_check(var, val):
    4.14 -    val = int(val)
    4.15 -    if val <= 0:
    4.16 -        raise ValueError
    4.17 -    return val
    4.18 -    
    4.19 -xm_vars.var('vmid',
    4.20 -            use="Virtual machine id. Integer greater than 0.",
    4.21 -            check=vmid_check)
    4.22 -
    4.23 -# This checks the script variables.
    4.24 -xm_vars.check()
    4.25 -
    4.26 -#----------------------------------------------------------------------------
    4.27 -# Kernel image file.
    4.28 -image = "/boot/netbsd"
    4.29 -
    4.30 -# The domain build function.
    4.31 -builder='netbsd'
    4.32 -
    4.33 -# Initial memory allocation (in megabytes) for the new domain.
    4.34 -memory = 16
    4.35 -
    4.36 -# A handy name for your new domain.
    4.37 -name = "NetBSD VM %d" % vmid
    4.38 -
    4.39 -#----------------------------------------------------------------------------
    4.40 -# Define network interfaces.
    4.41 -
    4.42 -# Number of network interfaces. Default is 1.
    4.43 -#nics=1
    4.44 -
    4.45 -# Optionally define mac and/or bridge for the network interfaces.
    4.46 -# Random MACs are assigned if not given.
    4.47 -#vif = [ 'mac=aa:00:00:00:00:11, bridge=xen-br0' ]
    4.48 -
    4.49 -# Specify IP address(es), for the new domain.  You need to
    4.50 -# configure IP addrs within the domain just as you do normally.  This
    4.51 -# is just to let Xen know about them so it can route packets
    4.52 -# appropriately.
    4.53 -
    4.54 -#ipaddr = [ xenctl.utils.add_offset_to_ip(xenctl.utils.get_current_ipaddr(),vmid),
    4.55 -#           xenctl.utils.add_offset_to_ip('169.254.1.0',vmid),
    4.56 -#           ]
    4.57 -
    4.58 -#----------------------------------------------------------------------------
    4.59 -# Define the disk devices you want the domain to have access to, and
    4.60 -# what you want them accessible as.
    4.61 -# Each disk entry is of the form phy:DEV,VDEV,MODE
    4.62 -# where DEV is the device, VDEV is the device name the domain will see,
    4.63 -# and MODE is r for read-only, w for read-write.
    4.64 -
    4.65 -#disk = [ 'phy:sda%d,sda1,w' % (7+vmid),
    4.66 -#         'phy:sda6,sda6,r' ]
    4.67 -
    4.68 -#----------------------------------------------------------------------------
    4.69 -# Set the kernel command line for the new domain.
    4.70 -# You only need to define the IP parameters and hostname if the domain's
    4.71 -# IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
    4.72 -# You can use 'extra' to set the runlevel and custom environment
    4.73 -# variables used by custom rc scripts (e.g. VMID=, usr= ).
    4.74 -
    4.75 -# Set if you want dhcp to allocate the IP address.
    4.76 -#dhcp="dhcp"
    4.77 -# Set netmask.
    4.78 -#netmask=
    4.79 -# Set default gateway.
    4.80 -#gateway=
    4.81 -# Set the hostname.
    4.82 -#hostname= "vm%d" % vmid
    4.83 -
    4.84 -# Set root device.
    4.85 -root = "/dev/sda1 ro"
    4.86 -
    4.87 -# Root device for nfs.
    4.88 -#root = "/dev/nfs"
    4.89 -# The nfs server.
    4.90 -#nfs_server = '169.254.1.0'  
    4.91 -# Root directory on the nfs server.
    4.92 -#nfs_root   = '/full/path/to/root/directory'
    4.93 -
    4.94 -# Sets runlevel 4 and the device for /usr.
    4.95 -#extra = "4 VMID=%d usr=/dev/sda6" % vmid
    4.96 -extra = "4 VMID=%d bootdev=xennet0" % vmid
    4.97 -
    4.98 -
    4.99 -#----------------------------------------------------------------------------
   4.100 -# Set according to whether you want the domain restarted when it exits.
   4.101 -# The default is 'onreboot', which restarts the domain when it shuts down
   4.102 -# with exit code reboot.
   4.103 -# Other values are 'always', and 'never'.
   4.104 -#
   4.105 -#restart = 'onreboot'
   4.106 -#============================================================================
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/tools/examples/xmnetbsd-example	Thu Jul 29 14:50:48 2004 +0000
     5.3 @@ -0,0 +1,123 @@
     5.4 +#  -*- mode: python; -*-
     5.5 +#============================================================================
     5.6 +# Example Python setup script for 'xm create'.
     5.7 +# This script sets the parameters used when a domain is created using 'xm create'.
     5.8 +#
     5.9 +# This is a relatively advanced script that uses a parameter, vmid, to control
    5.10 +# the settings. So this script can be used to start a set of domains by
    5.11 +# setting the vmid parameter on the 'xm create' command line. For example:
    5.12 +#
    5.13 +# xm create vmid=1
    5.14 +# xm create vmid=2
    5.15 +# xm create vmid=3
    5.16 +#
    5.17 +# The vmid is purely a script variable, and has no effect on the the domain
    5.18 +# id assigned to the new domain.
    5.19 +#============================================================================
    5.20 +
    5.21 +# Define script variables here.
    5.22 +# xm_vars is defined automatically, use xm_vars.var() to define a variable.
    5.23 +
    5.24 +# This function checks that 'vmid' has been given a valid value.
    5.25 +# It is called automatically by 'xm create'.
    5.26 +def vmid_check(var, val):
    5.27 +    val = int(val)
    5.28 +    if val <= 0:
    5.29 +        raise ValueError
    5.30 +    return val
    5.31 +
    5.32 +# Define the 'vmid' variable so that 'xm create' knows about it.
    5.33 +xm_vars.var('vmid',
    5.34 +            use="Virtual machine id. Integer greater than 0.",
    5.35 +            check=vmid_check)
    5.36 +
    5.37 +# Check the defined variables have valid values..
    5.38 +xm_vars.check()
    5.39 +
    5.40 +#----------------------------------------------------------------------------
    5.41 +# Kernel image file.
    5.42 +image = "/boot/netbsd"
    5.43 +
    5.44 +# The domain build function.
    5.45 +builder='netbsd'
    5.46 +
    5.47 +# Initial memory allocation (in megabytes) for the new domain.
    5.48 +memory = 16
    5.49 +
    5.50 +# A name for the new domain. All domains have to have different names,
    5.51 +# so we use the vmid to create a name.
    5.52 +name = "NETBSD%d" % vmid
    5.53 +
    5.54 +#----------------------------------------------------------------------------
    5.55 +# Define network interfaces.
    5.56 +
    5.57 +# Number of network interfaces. Default is 1.
    5.58 +#nics=1
    5.59 +
    5.60 +# Optionally define mac and/or bridge for the network interfaces.
    5.61 +# Random MACs are assigned if not given.
    5.62 +#vif = [ 'mac=aa:00:00:00:00:11, bridge=xen-br0' ]
    5.63 +
    5.64 +# Specify IP address(es), for the new domain.  You need to
    5.65 +# configure IP addrs within the domain just as you do normally.  This
    5.66 +# is just to let Xen know about them so it can route packets
    5.67 +# appropriately.
    5.68 +
    5.69 +#ipaddr = [ xenctl.utils.add_offset_to_ip(xenctl.utils.get_current_ipaddr(),vmid),
    5.70 +#           xenctl.utils.add_offset_to_ip('169.254.1.0',vmid),
    5.71 +#           ]
    5.72 +
    5.73 +#----------------------------------------------------------------------------
    5.74 +# Define the disk devices you want the domain to have access to, and
    5.75 +# what you want them accessible as.
    5.76 +# Each disk entry is of the form phy:UNAME,DEV,MODE
    5.77 +# where UNAME is the device, DEV is the device name the domain will see,
    5.78 +# and MODE is r for read-only, w for read-write.
    5.79 +
    5.80 +# This makes the disk device depend on the vmid - assuming
    5.81 +# that devices sda7, sda8 etc. exist. The device is exported
    5.82 +# to all domains as sda1.
    5.83 +# All domains get sda6 read-only (to use for /usr, see below).
    5.84 +disk = [ 'phy:sda%d,sda1,w' % (7+vmid),
    5.85 +         'phy:sda6,sda6,r' ]
    5.86 +
    5.87 +#----------------------------------------------------------------------------
    5.88 +# Set the kernel command line for the new domain.
    5.89 +# You only need to define the IP parameters and hostname if the domain's
    5.90 +# IP config doesn't, e.g. in ifcfg-eth0 or via DHCP.
    5.91 +# You can use 'extra' to set the runlevel and custom environment
    5.92 +# variables used by custom rc scripts (e.g. VMID=, usr= ).
    5.93 +
    5.94 +# Set if you want dhcp to allocate the IP address.
    5.95 +#dhcp="dhcp"
    5.96 +# Set netmask.
    5.97 +#netmask=
    5.98 +# Set default gateway.
    5.99 +#gateway=
   5.100 +# Set the hostname.
   5.101 +#hostname= "vm%d" % vmid
   5.102 +
   5.103 +# Set root device.
   5.104 +root = "/dev/sda1 ro"
   5.105 +
   5.106 +# Root device for nfs.
   5.107 +#root = "/dev/nfs"
   5.108 +# The nfs server.
   5.109 +#nfs_server = '169.254.1.0'  
   5.110 +# Root directory on the nfs server.
   5.111 +#nfs_root   = '/full/path/to/root/directory'
   5.112 +
   5.113 +# Sets runlevel 4 and the device for /usr.
   5.114 +#extra = "4 VMID=%d usr=/dev/sda6" % vmid
   5.115 +extra = "4 VMID=%d bootdev=xennet0" % vmid
   5.116 +
   5.117 +
   5.118 +#----------------------------------------------------------------------------
   5.119 +# Set according to whether you want the domain restarted when it exits.
   5.120 +# The default is 'onreboot', which restarts the domain when it shuts down
   5.121 +# with exit code reboot.
   5.122 +# Other values are 'always', and 'never'.
   5.123 +#
   5.124 +#restart = 'onreboot'
   5.125 +
   5.126 +#============================================================================