ia64/xen-unstable

changeset 8278:669b6252deee

Merged.
author emellor@leeni.uk.xensource.com
date Thu Dec 08 12:14:33 2005 +0000 (2005-12-08)
parents 8e74f2cf985e 7d7973a21a3d
children 4480e22f2ef2 fa1a93f3a322
files tools/python/xen/xend/XendDomain.py tools/python/xen/xm/migrate.py
line diff
     1.1 --- a/docs/src/user.tex	Thu Dec 08 12:13:06 2005 +0000
     1.2 +++ b/docs/src/user.tex	Thu Dec 08 12:14:33 2005 +0000
     1.3 @@ -905,14 +905,21 @@ This chapter summarizes the management s
     1.4  \section{\Xend\ }
     1.5  \label{s:xend}
     1.6  
     1.7 -The Xen Daemon (\Xend) performs system management functions related to
     1.8 -virtual machines. It forms a central point of control for a machine
     1.9 -and can be controlled using an HTTP-based protocol. \Xend\ must be
    1.10 -running in order to start and manage virtual machines.
    1.11 +
    1.12 +The \Xend\ node control daemon performs system management functions
    1.13 +related to virtual machines. It forms a central point of control of
    1.14 +virtualized resources, and must be running in order to start and manage
    1.15 +virtual machines. \Xend\ must be run as root because it needs access to
    1.16 +privileged system management functions.
    1.17  
    1.18 -\Xend\ must be run as root because it needs access to privileged system
    1.19 -management functions. A small set of commands may be issued on the
    1.20 -\xend\ command line:
    1.21 +An initialization script named \texttt{/etc/init.d/xend} is provided to
    1.22 +start \Xend\ at boot time. Use the tool appropriate (i.e. chkconfig) for
    1.23 +your Linux distribution to specify the runlevels at which this script
    1.24 +should be executed, or manually create symbolic links in the correct
    1.25 +runlevel directories.
    1.26 +
    1.27 +\Xend\ can be started on the command line as well, and supports the
    1.28 +following set of parameters:
    1.29  
    1.30  \begin{tabular}{ll}
    1.31    \verb!# xend start! & start \xend, if not already running \\
    1.32 @@ -929,9 +936,62 @@ the appropriate runlevel directories or 
    1.33  where available.  Once \xend\ is running, administration can be done
    1.34  using the \texttt{xm} tool.
    1.35  
    1.36 -As \xend\ runs, events will be logged to \path{/var/log/xend.log}
    1.37 -and \path{/var/log/xend-debug.log}. These, along with the standard 
    1.38 -syslog files, are useful when troubleshooting problems.
    1.39 +\subsection{Logging}
    1.40 +
    1.41 +As \xend\ runs, events will be logged to \path{/var/log/xend.log} and
    1.42 +(less frequently) to \path{/var/log/xend-debug.log}. These, along with
    1.43 +the standard syslog files, are useful when troubleshooting problems.
    1.44 +
    1.45 +\subsection{Configuring \Xend\ }
    1.46 +
    1.47 +\Xend\ is written in Python. At startup, it reads its configuration
    1.48 +information from the file \path{/etc/xen/xend-config.sxp}. The Xen
    1.49 +installation places an example \texttt{xend-config.sxp} file in the
    1.50 +\texttt{/etc/xen} subdirectory which should work for most installations.
    1.51 +
    1.52 +See the example configuration file \texttt{xend-debug.sxp} and the
    1.53 +section 5 man page \texttt{xend-config.sxp} for a full list of
    1.54 +parameters and more detailed information. Some of the most important
    1.55 +parameters are discussed below.
    1.56 +
    1.57 +An HTTP interface and a Unix domain socket API are available to
    1.58 +communicate with \Xend. This allows remote users to pass commands to the
    1.59 +daemon. By default, \Xend does not start an HTTP server. It does start a
    1.60 +Unix domain socket management server, as the low level utility
    1.61 +\texttt{xm} requires it. For support of cross-machine migration, \Xend\
    1.62 +can start a relocation server. This support is not enabled by default
    1.63 +for security reasons.
    1.64 +
    1.65 +Note: the example \texttt{xend} configuration file modifies the defaults and
    1.66 +starts up \Xend\ as an HTTP server as well as a relocation server.
    1.67 +
    1.68 +From the file:
    1.69 +
    1.70 +\begin{verbatim}
    1.71 +#(xend-http-server no)
    1.72 +(xend-http-server yes)
    1.73 +#(xend-unix-server yes)
    1.74 +#(xend-relocation-server no)
    1.75 +(xend-relocation-server yes)
    1.76 +\end{verbatim}
    1.77 +
    1.78 +Comment or uncomment lines in that file to disable or enable features
    1.79 +that you require.
    1.80 +
    1.81 +Connections from remote hosts are disabled by default:
    1.82 +
    1.83 +\begin{verbatim}
    1.84 +# Address xend should listen on for HTTP connections, if xend-http-server is
    1.85 +# set.
    1.86 +# Specifying 'localhost' prevents remote connections.
    1.87 +# Specifying the empty string '' (the default) allows all connections.
    1.88 +#(xend-address '')
    1.89 +(xend-address localhost)
    1.90 +\end{verbatim}
    1.91 +
    1.92 +It is recommended that if migration support is not needed, the
    1.93 +\texttt{xend-relocation-server} parameter value be changed to
    1.94 +``\texttt{no}'' or commented out.
    1.95  
    1.96  \section{Xm}
    1.97  \label{s:xm}
    1.98 @@ -992,7 +1052,7 @@ The meaning of each field is as follows:
    1.99  \end{quote}
   1.100  
   1.101  The \path{xm list} command also supports a long output format when the
   1.102 -\path{-l} switch is used.  This outputs the fulls details of the
   1.103 +\path{-l} switch is used.  This outputs the full details of the
   1.104  running domains in \xend's SXP configuration format.
   1.105  
   1.106  
     2.1 --- a/tools/python/xen/xend/XendClient.py	Thu Dec 08 12:13:06 2005 +0000
     2.2 +++ b/tools/python/xen/xend/XendClient.py	Thu Dec 08 12:14:33 2005 +0000
     2.3 @@ -256,12 +256,13 @@ class Xend:
     2.4                               {'op'      : 'save',
     2.5                                'file'    : filename })
     2.6  
     2.7 -    def xend_domain_migrate(self, id, dst, live=0, resource=0):
     2.8 +    def xend_domain_migrate(self, id, dst, live=0, resource=0, port=0):
     2.9          return self.xendPost(self.domainurl(id),
    2.10                               {'op'         : 'migrate',
    2.11                                'destination': dst,
    2.12                                'live'       : live,
    2.13 -                              'resource'   : resource })
    2.14 +                              'resource'   : resource,
    2.15 +                              'port'       : port })
    2.16  
    2.17      def xend_domain_pincpu(self, id, vcpu, cpumap):
    2.18          return self.xendPost(self.domainurl(id),
     3.1 --- a/tools/python/xen/xend/XendDomain.py	Thu Dec 08 12:13:06 2005 +0000
     3.2 +++ b/tools/python/xen/xend/XendDomain.py	Thu Dec 08 12:14:33 2005 +0000
     3.3 @@ -390,7 +390,7 @@ class XendDomain:
     3.4                  raise XendError(str(ex))
     3.5          return val       
     3.6  
     3.7 -    def domain_migrate(self, domid, dst, live=False, resource=0):
     3.8 +    def domain_migrate(self, domid, dst, live=False, resource=0, port=0):
     3.9          """Start domain migration."""
    3.10  
    3.11          dominfo = self.domain_lookup(domid)
    3.12 @@ -398,7 +398,8 @@ class XendDomain:
    3.13          if dominfo.getDomid() == PRIV_DOMAIN:
    3.14              raise XendError("Cannot migrate privileged domain %i" % domid)
    3.15  
    3.16 -        port = xroot.get_xend_relocation_port()
    3.17 +        if port == 0:
    3.18 +            port = xroot.get_xend_relocation_port()
    3.19          try:
    3.20              sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    3.21              sock.connect((dst, port))
     4.1 --- a/tools/python/xen/xend/server/SrvDomain.py	Thu Dec 08 12:13:06 2005 +0000
     4.2 +++ b/tools/python/xen/xend/server/SrvDomain.py	Thu Dec 08 12:14:33 2005 +0000
     4.3 @@ -90,7 +90,8 @@ class SrvDomain(SrvDir):
     4.4                      [['dom',         'int'],
     4.5                       ['destination', 'str'],
     4.6                       ['live',        'int'],
     4.7 -                     ['resource',    'int']])
     4.8 +                     ['resource',    'int'],
     4.9 +                     ['port',        'int']])
    4.10          return fn(req.args, {'dom': self.dom.domid})
    4.11  
    4.12      def op_pincpu(self, _, req):
     5.1 --- a/tools/python/xen/xm/migrate.py	Thu Dec 08 12:13:06 2005 +0000
     5.2 +++ b/tools/python/xen/xm/migrate.py	Thu Dec 08 12:14:33 2005 +0000
     5.3 @@ -38,6 +38,10 @@ gopts.opt('live', short='l',
     5.4            fn=set_true, default=0,
     5.5            use="Use live migration.")
     5.6  
     5.7 +gopts.opt('port', short='p',
     5.8 +          fn=set_int, default=0,
     5.9 +          use="Use specified port for migration.")
    5.10 +
    5.11  gopts.opt('resource', short='r', val='MBIT',
    5.12            fn=set_int, default=0,
    5.13            use="Set level of resource usage for migration.")
    5.14 @@ -56,4 +60,4 @@ def main(argv):
    5.15          opts.err('Invalid arguments: ' + str(args))
    5.16      dom = args[0]
    5.17      dst = args[1]
    5.18 -    server.xend_domain_migrate(dom, dst, opts.vals.live, opts.vals.resource)
    5.19 +    server.xend_domain_migrate(dom, dst, opts.vals.live, opts.vals.resource, opts.vals.port)