Diff for /wikisrc/ports/xen/howto.mdwn between versions 1.41 and 1.46

version 1.41, 2014/12/26 13:04:31 version 1.46, 2014/12/26 16:43:51
Line 181  NetBSD, which is not yet a dom0, and the Line 181  NetBSD, which is not yet a dom0, and the
 NetBSD install to a dom0 install by just changing the kernel and boot  NetBSD install to a dom0 install by just changing the kernel and boot
 configuration.  configuration.
   
   For experimenting with Xen, a machine with as little as 1G of RAM and
   100G of disk can work.  For running many domUs in productions, far
   more will be needed.
   
 Styles of dom0 operation  Styles of dom0 operation
 ------------------------  ------------------------
   
Line 301  is using xm or xl.  Note that xend is fo Line 305  is using xm or xl.  Note that xend is fo
 only be used if you plan on using "xm".  Do NOT enable xend if you  only be used if you plan on using "xm".  Do NOT enable xend if you
 plan on using "xl" as it will cause problems.  plan on using "xl" as it will cause problems.
   
   The installation of NetBSD should already have created devices for xen
   (xencons, xenevt), but if they are not present, create them:
   
           cd /dev && sh MAKEDEV xen
   
 TODO: Give 3.1 advice (or remove it from pkgsrc).  TODO: Give 3.1 advice (or remove it from pkgsrc).
   
 For 3.3 (and thus xm), add to rc.conf (but note that you should have  For 3.3 (and thus xm), add to rc.conf (but note that you should have
Line 329  For 4.2 with xl (preferred), add to rc.c Line 338  For 4.2 with xl (preferred), add to rc.c
   
 TODO: Recommend for/against xen-watchdog.  TODO: Recommend for/against xen-watchdog.
   
 After you have configured the daemons and rebooted, run the following  After you have configured the daemons and either started them or
 (or use xl) to inspect Xen's boot messages, available resources, and  rebooted, run the following (or use xl) to inspect Xen's boot
 running domains:  messages, available resources, and running domains:
   
         xm dmesg          # xm dmesg
         xm info          [xen's boot info]
         xm list          # xm info
           [available memory, etc.]
           # xm list
           Name              Id  Mem(MB)  CPU  State  Time(s)  Console
           Domain-0           0       64    0  r----     58.1
   
 anita (for testing NetBSD)  anita (for testing NetBSD)
 --------------------------  --------------------------
Line 452  similarly to vnds. Line 465  similarly to vnds.
 Virtual Networking  Virtual Networking
 ------------------  ------------------
   
 TODO: explain xvif concept, and that it's general.  Xen provides virtual ethernets, each of which connects the dom0 and a
   domU.  For each virtual network, there is an interface "xvifN.M" in
 There are two normal styles: bridging and NAT.  the dom0, and in domU index N, a matching interface xennetM (NetBSD
   name).  The interfaces behave as if there is an Ethernet with two
   adaptors connected.  From this primitive, one can construct various
   configurations.  We focus on two common and useful cases for which
   there are existing scripts: bridging and NAT.
   
 With bridging, the domU perceives itself to be on the same network as  With bridging, the domU perceives itself to be on the same network as
 the dom0.  For server virtualization, this is usually best.  the dom0.  For server virtualization, this is usually best.  Bridging
   is accomplished by creating a bridge(4) device and adding the dom0's
   physical interface and the various xvifN.0 interfaces to the bridge.
   One specifies "bridge=bridge0" in the domU config file.  The bridge
   must be set up already in the dom0; an example /etc/ifconfig.bridge0
   is:
   
           create
           up
           !brconfig bridge0 add wm0
   
 With NAT, the domU perceives itself to be behind a NAT running on the  With NAT, the domU perceives itself to be behind a NAT running on the
 dom0.  This is often appropriate when running Xen on a workstation.  dom0.  This is often appropriate when running Xen on a workstation.
   
 One can construct arbitrary other configurations, but there is no  
 script support.  
   
 Sizing domains  Sizing domains
 --------------  --------------
   
Line 496  obtain domU kernels. Line 519  obtain domU kernels.
 Config files  Config files
 ------------  ------------
   
 TODO: give example config files.   Use both lvm and vnd.  The following is an example domain configuration file, lightly
   sanitized from a known working on Xen 4.1 (NetBSD 5 amd64 dom0 and
   NetBSD 6 i386 domU):
   
           # -*- mode: python; -*-
   
           kernel = "/netbsd-XEN3PAE_DOMU-i386-foo.gz"
   
           memory = 1024
   
           name = "foo"
   
           #cpu = -1
   
           vif = [ 'mac=aa:00:00:d1:00:09,bridge=bridge0' ]
   
 TODO: explain the mess with 3 arguments for disks and how to cope (0x1).          disk = [ 'file:/n0/xen/foo-wd0,0x1,w',
                    'file:/n0/xen/foo-wd1,0x2,w' ]
   
           root = "xbd0"
   
           autorestart = True
   
   The kernel has the host/domU name in it, so that on the dom0 one can
   update the various domUs independently.  The vif line causes an
   interface to be provided, with a specific mac address (do not reuse
   MAC addresses!), in bridge mode.  Two disks are provided, and they are
   writable.
   
   TODO: explain if the root line is really necessary.
   TODO: explain or remove autorestart.
   
   TODO: Add an example with lvm
   
   TODO: explain, someplace the mess with 3 arguments for disks and how to cope (0x1).
   
 Starting domains  Starting domains
 ----------------  ----------------
Line 513  Creating specific unprivileged domains ( Line 568  Creating specific unprivileged domains (
   
 Creating domUs is almost entirely independent of operating system.  We  Creating domUs is almost entirely independent of operating system.  We
 first explain NetBSD, and then differences for Linux and Solaris.  first explain NetBSD, and then differences for Linux and Solaris.
   Note that you must have already completed the dom0 setup so that "xm
   list" (or "xl list") works.
   
 Creating an unprivileged NetBSD domain (domU)  Creating an unprivileged NetBSD domain (domU)
 ---------------------------------------------  ---------------------------------------------
   
 Once you have *domain0* running, you need to start the xen tool daemon  
 (`/usr/pkg/share/examples/rc.d/xend start`) and the xen backend daemon  
 (`/usr/pkg/share/examples/rc.d/xenbackendd start` for Xen3\*,  
 `/usr/pkg/share/examples/rc.d/xencommons start` for Xen4.\*). Make sure  
 that `/dev/xencons` and `/dev/xenevt` exist before starting `xend`. You  
 can create them with this command:  
   
     # cd /dev && sh MAKEDEV xen  
   
 xend will write logs to `/var/log/xend.log` and  
 `/var/log/xend-debug.log`. You can then control xen with the xm tool.  
 'xm list' will show something like:  
   
     # xm list  
     Name              Id  Mem(MB)  CPU  State  Time(s)  Console  
     Domain-0           0       64    0  r----     58.1  
   
 'xm create' allows you to create a new domain. It uses a config file in  'xm create' allows you to create a new domain. It uses a config file in
 PKG\_SYSCONFDIR for its parameters. By default, this file will be in  PKG\_SYSCONFDIR for its parameters. By default, this file will be in
 `/usr/pkg/etc/xen/`. On creation, a kernel has to be specified, which  `/usr/pkg/etc/xen/`. On creation, a kernel has to be specified, which
Line 657  working vif-bridge is also provided with Line 697  working vif-bridge is also provided with
   
     #!/bin/sh      #!/bin/sh
     #============================================================================      #============================================================================
     # $NetBSD: howto.mdwn,v 1.40 2014/12/26 13:00:23 gdt Exp $      # $NetBSD: howto.mdwn,v 1.45 2014/12/26 16:17:25 gdt Exp $
     #      #
     # /usr/pkg/etc/xen/vif-bridge      # /usr/pkg/etc/xen/vif-bridge
     #      #
Line 1047  TODO: Perhaps reference panix, prmgr, am Line 1087  TODO: Perhaps reference panix, prmgr, am
   
 TODO: Somewhere, discuss pvgrub and py-grub to load the domU kernel  TODO: Somewhere, discuss pvgrub and py-grub to load the domU kernel
 from the domU filesystem.  from the domU filesystem.
   
   Using npf
   ---------
   
   In standard kernels, npf is a module, and thus cannot be loadeed in a
   DOMU kernel.
   
   TODO: explain how to compile npf into a custom kernel, answering:
   http://mail-index.netbsd.org/netbsd-users/2014/12/26/msg015576.html

Removed from v.1.41  
changed lines
  Added in v.1.46


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb