Using the 2.0.6 demo cd image, I booted the supplied freebsd image and rsync''d the file system to an NFS server. However I don not seem to be able to succesfully boot from it the system just hangs here: xn0: bpf attached xn0: Ethernet address: aa:00:00:61:1c:d4 lo0: bpf I have modified /sbin/start_freebsd.sh and /etc/xen/freebsd.py to generate the following configuration: xendemo:~# start_freebsd.sh Starting new guest domain Using config file "/etc/xen/freebsd.py". (vm (name FreeBSD-69) (memory 48) (cpu 69) (image (linux (kernel /boot/freebsd) (ip 10.0.0.246:10.0.0.19::255.255.255.0::eth0:off) (root /dev/dns) (args ''nfsroot=10.0.0.19:/FreeBSD53 ,vfs.root.mountfrom=nfs:10.0.0.19:/FreeBSD53,boot_verbose=yes,boot_single=yes'' ) ) ) (device (vif (mac aa:00:00:5b:7a:53))) ) Is there something I am missing? The bridge seems OK I can access the nfs exports from the demo cd''s default DomUs. I include my modified files, as I am currently using a fixed IP I have only been launching one instance of FreeBSD at a time. xendemo:~# brctl show bridge name bridge id STP enabled interfaces xen-br0 8000.00110a543046 no eth0 vif31.0 xendemo:~# ifconfig xen-br0 xen-br0 Link encap:Ethernet HWaddr 00:11:0A:54:30:46 inet addr:10.0.0.237 Bcast:10.255.255.255 Mask:255.0.0.0 inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:291944 errors:0 dropped:0 overruns:0 frame:0 TX packets:533910 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:16437710 (15.6 MiB) TX bytes:77603155 (74.0 MiB) xendemo:~# ping 10.0.0.19 PING 10.0.0.19 (10.0.0.19) 56(84) bytes of data. 64 bytes from 10.0.0.19: icmp_seq=1 ttl=64 time=7.95 ms 64 bytes from 10.0.0.19: icmp_seq=2 ttl=64 time=0.416 ms 64 bytes from 10.0.0.19: icmp_seq=3 ttl=64 time=0.342 ms new FreeBSD guest domain # Wait for the user if we''re called on a VT if [ $PPID -eq 1 ] ; then echo echo "Press Enter to start a new FreeBSD guest OS" read fi # First it needs an ID VMID=`/sbin/get_next_vmid.sh` # Now here we go echo "Starting new guest domain" echo xm create -c -f /etc/xen/freebsd.py \ root=/dev/dns \ name=FreeBSD-$VMID \ kernel=/boot/freebsd \ ip=''10.0.0.246'' \ netmask=''255.255.255.0'' \ nfs_server=''10.0.0.19'' \ nfs_root=/FreeBSD53 \ blkif=no \ netif=no \ memory=48 \ vmid=$VMID xendemo:~# xendemo:~# cat /etc/xen/freebsd.py import xen.util.ip ##### Edit this python file to reflect the configuration of your system ##### This example script expects a variable called ''vmid'' to be set. def config_usage (): print >>sys.stderr,""" The config file ''%s'' requires the following variable to be defined: vmid -- Numeric identifier for the new domain, used to calculate the VM''s IP address and root partition. E.g. -Dvmid=1 Additionally the following variable may be defined: image -- Path to kernel image, can be gzip''ed. [/boot/freebsd] mem -- Memory size. [16] name -- Domain name. [FreeBSD VM vmid] ip -- Primary IP address for domain. [this domain''s IP + vmid] nfsserv -- NFS server IP address. [169.254.1.0] nfsroot -- Path to nfs root filesystem. [/netboot/freebsd] """ % config_file # Define script variables here. # xm_vars is defined automatically, use xm_vars.var() to define a variable. def vmid_check(var, val): val = int(val) if val <= 0: raise ValueError return val xm_vars.var(''vmid'', use="Virtual machine id. Integer greater than 0.", check=vmid_check) # This checks the script variables. xm_vars.check() try: kernel = kernel except: kernel = "/u/kmacy/kernel" builder=''linux'' # this is a FreeBSD domain # STEP 2. The initial memory allocation (in megabytes) for the new domain. try: memory = int(mem) except: memory = 256 # STEP 3. A handy name for your new domain. try: name = name except: name = "FreeBSD VM %d" % vmid # STEP 3A. Which CPU to start domain on? cpu = vmid # set based on vmid (mod number of CPUs) # STEP 4. Specify IP address(es), for the new domain. You need to # configure IP addrs within the domain just as you do normally. This # is just to let Xen know about them so it can route packets # appropriately. #vfr_ipaddr = ["111.222.333.444","222.333.444.555"] # try: # vfr_ipaddr = [ip, xenctl.utils.add_offset_to_ip(''169.254.1.0'',vmid),] # except: # vfr_ipaddr = [xenctl.utils.add_offset_to_ip(xenctl.get_current_ipaddr(),vmid), # xenctl.utils.add_offset_to_ip(''169.254.1.0'',vmid),] #vfr_ipaddr = ["10.56.11.30"]; vfr_ipaddr = ["10.0.0.246"] # xen-vm0 # STEP 5a. Identify any physcial partitions or virtual disks you want the # domain to have access to, and what you want them accessible as # e.g. vbd_list = [ (''phy:sda6'',''sda6'', ''w''), # (''phy:sda%d'' % (3+vmid), ''hda2'', ''r''), # (''vd:as73gd784dh'',''hda1'',''w''), # (''phy:cdrom'',''hdd'',''r'') #disk = [ ''phy:loopa,loopa,w'' ] # STEP 5b. Set the VBD expertise level. Most people should leave this # on 0, at least to begin with - this script can detect most dangerous # disk sharing between domains and with this set to zero it will only # allow read only sharing. vbd_expert = 0 # STEP 6. Build the command line for the new domain. Edit as req''d. # You only need the ip= line if you''re NFS booting or the root file system # doesn''t set it later e.g. in ifcfg-eth0 or via DHCP # You can use ''extrabit'' to set the runlevel and custom environment # variables used by custom rc scripts (e.g. VMID=, usr= ) netmask = xen.util.ip.get_current_ipmask() gateway = xen.util.ip.get_current_ipgw() try: nfsserv except: nfsserv = ''10.0.0.19'' extra = "boot.netif.ip="+vfr_ipaddr[0] extra += ",boot.netif.netmask="+netmask extra = ",vfs.root.mountfrom=nfs:10.0.0.19:/FreeBSD53" extra += ",boot_verbose=yes" extra += ",boot_single=yes" #extra += ",boot_gdb=yes" #extra += ",boot_gdb_pause=yes" #cmdline_ip += ",init_path=/sbin:/sbin/init" # there is no real MAC address - need hack in device driver # cmdline_ip += ",boot.netif.hwaddr=00:00:00:00:00:00" # cmdline_ip += ",boot.nfsroot.server="+nfsserv # try: # cmdline_ip += ",boot.nfsroot.path="+nfspath # except: # cmdline_ip += ",boot.nfsroot.path=/netboot/freebsd" # something is appending garbage to the end - make sure it is separate # cmdline_ip += "," # STEP 7. Set according to whether you want the script to watch the domain # and auto-restart it should it die or exit. auto_restart = False #auto_restart = True xendemo:~# _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
I vaguely recall disabling xenFreeBSD''s diskless support. One alternative is to have a small loopback mounted root with the majority of your files exported over NFS. -Kip On 9/8/05, Geoff Buckingham <geoffb@chuggalug.clues.com> wrote:> > > Using the 2.0.6 demo cd image, I booted the supplied freebsd image and > rsync''d > the file system to an NFS server. However I don not seem to be able to > succesfully boot from it the system just hangs here: > > xn0: bpf attached > xn0: Ethernet address: aa:00:00:61:1c:d4 > lo0: bpf > > I have modified /sbin/start_freebsd.sh and /etc/xen/freebsd.py to generate > the following configuration: > > xendemo:~# start_freebsd.sh > Starting new guest domain > > Using config file "/etc/xen/freebsd.py". > (vm > (name FreeBSD-69) > (memory 48) > (cpu 69) > (image > (linux > (kernel /boot/freebsd) > (ip 10.0.0.246:10 <http://10.0.0.246:10>.0.0.19::255.255.255.0::eth0:off) > (root /dev/dns) > (args > ''nfsroot=10.0.0.19:/FreeBSD53 ,vfs.root.mountfrom=nfs:10.0.0.19:/FreeBSD53 > ,boot_verbose=yes,boot_single=yes'' > ) > ) > ) > (device (vif (mac aa:00:00:5b:7a:53))) > ) > > Is there something I am missing? The bridge seems OK I can access the nfs > exports from the demo cd''s default DomUs. > > I include my modified files, as I am currently using a fixed IP I have > only > been launching one instance of FreeBSD at a time. > > xendemo:~# brctl show > bridge name bridge id STP enabled interfaces > xen-br0 8000.00110a543046 no eth0 > vif31.0 > xendemo:~# ifconfig xen-br0 > xen-br0 Link encap:Ethernet HWaddr 00:11:0A:54:30:46 > inet addr:10.0.0.237 <http://10.0.0.237> Bcast:10.255.255.255<http://10.255.255.255>Mask: > 255.0.0.0 <http://255.0.0.0> > inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:291944 errors:0 dropped:0 overruns:0 frame:0 > TX packets:533910 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:0 > RX bytes:16437710 (15.6 MiB) TX bytes:77603155 (74.0 MiB) > > xendemo:~# ping 10.0.0.19 <http://10.0.0.19> > PING 10.0.0.19 <http://10.0.0.19> (10.0.0.19 <http://10.0.0.19>) 56(84) > bytes of data. > 64 bytes from 10.0.0.19 <http://10.0.0.19>: icmp_seq=1 ttl=64 time=7.95 ms > 64 bytes from 10.0.0.19 <http://10.0.0.19>: icmp_seq=2 ttl=64 time=0.416ms > 64 bytes from 10.0.0.19 <http://10.0.0.19>: icmp_seq=3 ttl=64 time=0.342ms > > new FreeBSD guest domain > > # Wait for the user if we''re called on a VT > if [ $PPID -eq 1 ] ; then > echo > echo "Press Enter to start a new FreeBSD guest OS" > read > fi > > # First it needs an ID > VMID=`/sbin/get_next_vmid.sh` > > # Now here we go > echo "Starting new guest domain" > echo > > xm create -c -f /etc/xen/freebsd.py \ > root=/dev/dns \ > name=FreeBSD-$VMID \ > kernel=/boot/freebsd \ > ip=''10.0.0.246 <http://10.0.0.246>'' \ > netmask=''255.255.255.0 <http://255.255.255.0>'' \ > nfs_server=''10.0.0.19 <http://10.0.0.19>'' \ > nfs_root=/FreeBSD53 \ > blkif=no \ > netif=no \ > memory=48 \ > vmid=$VMID > xendemo:~# > > xendemo:~# cat /etc/xen/freebsd.py > import xen.util.ip > > ##### Edit this python file to reflect the configuration of your system > > ##### This example script expects a variable called ''vmid'' to be set. > > def config_usage (): > print >>sys.stderr,""" > The config file ''%s'' requires the following variable to be defined: > vmid -- Numeric identifier for the new domain, used to calculate > the VM''s IP address and root partition. E.g. -Dvmid=1 > > Additionally the following variable may be defined: > image -- Path to kernel image, can be gzip''ed. [/boot/freebsd] > mem -- Memory size. [16] > name -- Domain name. [FreeBSD VM vmid] > ip -- Primary IP address for domain. [this domain''s IP + vmid] > nfsserv -- NFS server IP address. [169.254.1.0 <http://169.254.1.0>] > nfsroot -- Path to nfs root filesystem. [/netboot/freebsd] > """ % config_file > > # Define script variables here. > # xm_vars is defined automatically, use xm_vars.var() to define a > variable. > > def vmid_check(var, val): > val = int(val) > if val <= 0: > raise ValueError > return val > > xm_vars.var(''vmid'', > use="Virtual machine id. Integer greater than 0.", > check=vmid_check) > > # This checks the script variables. > xm_vars.check() > > try: > kernel = kernel > except: > kernel = "/u/kmacy/kernel" > > builder=''linux'' # this is a FreeBSD domain > > > # STEP 2. The initial memory allocation (in megabytes) for the new domain. > try: > memory = int(mem) > except: > memory = 256 > > > # STEP 3. A handy name for your new domain. > try: > name = name > except: > name = "FreeBSD VM %d" % vmid > > # STEP 3A. Which CPU to start domain on? > cpu = vmid # set based on vmid (mod number of CPUs) > > > # STEP 4. Specify IP address(es), for the new domain. You need to > # configure IP addrs within the domain just as you do normally. This > # is just to let Xen know about them so it can route packets > # appropriately. > > #vfr_ipaddr = ["111.222.333.444","222.333.444.555"] > # try: > # vfr_ipaddr = [ip, xenctl.utils.add_offset_to_ip(''169.254.1.0<http://169.254.1.0> > '',vmid),] > # except: > # vfr_ipaddr = [xenctl.utils.add_offset_to_ip(xenctl.get_current_ipaddr > (),vmid), > # xenctl.utils.add_offset_to_ip(''169.254.1.0 <http://169.254.1.0>'',vmid),] > #vfr_ipaddr = ["10.56.11.30 <http://10.56.11.30>"]; > vfr_ipaddr = ["10.0.0.246 <http://10.0.0.246>"] # xen-vm0 > > # STEP 5a. Identify any physcial partitions or virtual disks you want the > # domain to have access to, and what you want them accessible as > # e.g. vbd_list = [ (''phy:sda6'',''sda6'', ''w''), > # (''phy:sda%d'' % (3+vmid), ''hda2'', ''r''), > # (''vd:as73gd784dh'',''hda1'',''w''), > # (''phy:cdrom'',''hdd'',''r'') > > #disk = [ ''phy:loopa,loopa,w'' ] > > > # STEP 5b. Set the VBD expertise level. Most people should leave this > # on 0, at least to begin with - this script can detect most dangerous > # disk sharing between domains and with this set to zero it will only > # allow read only sharing. > > vbd_expert = 0 > > > # STEP 6. Build the command line for the new domain. Edit as req''d. > # You only need the ip= line if you''re NFS booting or the root file system > # doesn''t set it later e.g. in ifcfg-eth0 or via DHCP > # You can use ''extrabit'' to set the runlevel and custom environment > # variables used by custom rc scripts (e.g. VMID=, usr= ) > > netmask = xen.util.ip.get_current_ipmask() > gateway = xen.util.ip.get_current_ipgw() > try: > nfsserv > except: > nfsserv = ''10.0.0.19 <http://10.0.0.19>'' > > extra = "boot.netif.ip="+vfr_ipaddr[0] > extra += ",boot.netif.netmask="+netmask > extra = ",vfs.root.mountfrom=nfs:10.0.0.19:/FreeBSD53" > extra += ",boot_verbose=yes" > extra += ",boot_single=yes" > #extra += ",boot_gdb=yes" > #extra += ",boot_gdb_pause=yes" > > #cmdline_ip += ",init_path=/sbin:/sbin/init" > # there is no real MAC address - need hack in device driver > # cmdline_ip += ",boot.netif.hwaddr=00:00:00:00:00:00" > # cmdline_ip += ",boot.nfsroot.server="+nfsserv > # try: > # cmdline_ip += ",boot.nfsroot.path="+nfspath > # except: > # cmdline_ip += ",boot.nfsroot.path=/netboot/freebsd" > # something is appending garbage to the end - make sure it is separate > # cmdline_ip += "," > > # STEP 7. Set according to whether you want the script to watch the domain > # and auto-restart it should it die or exit. > > auto_restart = False > #auto_restart = True > > xendemo:~# > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Thu, Sep 08, 2005 at 11:42:29AM -0700, Kip Macy wrote:> I vaguely recall disabling xenFreeBSD''s diskless support. One alternative is > to have a small loopback mounted root with the majority of your files > exported over NFS. >It seems odd that it hangs in the bpf initialisation though. When you say you disabled xenFreeBSD''s diskless support, is it missing an option NFSROOT in the kernel or has the code gone? I ask as i am interested in being able use xen to migrate freebsd instances about between individual servers. Pure NAS would greatly simplify this. (I notice the OpenSolaris xen guys say they brought their stuff up on NFS for this reason.) _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Thu, Sep 08, 2005 at 09:36:08PM +0000, Geoff Buckingham wrote:> On Thu, Sep 08, 2005 at 11:42:29AM -0700, Kip Macy wrote: > > I vaguely recall disabling xenFreeBSD''s diskless support. One alternative is > > to have a small loopback mounted root with the majority of your files > > exported over NFS. > > > It seems odd that it hangs in the bpf initialisation though. > > When you say you disabled xenFreeBSD''s diskless support, is it missing an > option NFSROOT in the kernel or has the code gone? >To answer my own question for the sake of the archive, to boot diskless FreeBSD DomU environment you need to follw Kip Macey''s instuctions with a few changes: Download and extract the xen 2.0.7 source tarball. Download FreeBSD 5.3 source. I was able to use a cvsup of RELENG_5_3 which incorporates the security fixes since 5.3 RELEASE. I used the i386-xeno.tgz source from http://www.fsmware.com/xenofreebsd/5.3/050123/i386-xeno.tgz ther may be a more recent tarball...this worked so far. Building the current image: 1) on a machine running FreeBSD 5.3 download i386-xeno.tgz kmacy@freebird cd /sys kmacy@freebird tar xzf ~/i386-xeno.tgz kmacy@freebird cd conf (assumes csh) kmacy@freebird foreach file ( ../i386-xeno/sys/conf/*.i386-xeno ) foreach? ln -s $file kmacy@freebird cd ../i386-xeno/conf/ Edit XENCONF, uncomment "options NFS_ROOT" and add the following: options BOOTP options BOOTP_NFSROOT options BOOTP_COMPAT As I had some issues compiling agp kernel modules I didn''t need I suggest you edit /etc/make.conf and add ''NO_MODULES="YES"'' # create compile directory kmacy@freebird config XENCONF Kernel build directory is ../compile/XENCONF Don''t forget to do a ``make depend'''' kmacy@freebird cd ../../include/ # link in xen interface headers kmacy@freebird ln -s <PATH to your XEN source>/xen/include/public hypervisor-ifs kmacy@freebird cd ../compile/XENCONF kmacy@freebird make kernel-depend # build kernel kmacy@freebird make -j4 kernel <...> linking kernel.debug text data bss dec hex filename 2057881 135964 179472 2373317 2436c5 kernel.debug objcopy --strip-debug kernel.debug kernel The kernel you get is only realy any good for diskless use but needs no extra kenv arguments passed to it. It will pick up NFS server and path from a DHCP or BOOTP server. (i.e. you can comment out all the ''extra'' string definitions in freebsd.phy _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Congratulations on getting it to work. I''m sorry about the frustration. The BPF hang seems to happen if you leave out some of the network options. -Kip On 9/11/05, Geoff Buckingham <geoffb@chuggalug.clues.com> wrote:> > On Thu, Sep 08, 2005 at 09:36:08PM +0000, Geoff Buckingham wrote: > > On Thu, Sep 08, 2005 at 11:42:29AM -0700, Kip Macy wrote: > > > I vaguely recall disabling xenFreeBSD''s diskless support. One > alternative is > > > to have a small loopback mounted root with the majority of your files > > > exported over NFS. > > > > > It seems odd that it hangs in the bpf initialisation though. > > > > When you say you disabled xenFreeBSD''s diskless support, is it missing > an > > option NFSROOT in the kernel or has the code gone? > > > > To answer my own question for the sake of the archive, to boot diskless > FreeBSD DomU environment you need to follw Kip Macey''s instuctions with a > few changes: > > Download and extract the xen 2.0.7 source tarball. > Download FreeBSD 5.3 source. I was able to use a cvsup of RELENG_5_3 which > incorporates the security fixes since 5.3 RELEASE. > I used the i386-xeno.tgz source from > > http://www.fsmware.com/xenofreebsd/5.3/050123/i386-xeno.tgz > > ther may be a more recent tarball...this worked so far. > > Building the current image: > 1) on a machine running FreeBSD 5.3 download i386-xeno.tgz > kmacy@freebird cd /sys > kmacy@freebird tar xzf ~/i386-xeno.tgz > kmacy@freebird cd conf > (assumes csh) > kmacy@freebird foreach file ( ../i386-xeno/sys/conf/*.i386-xeno ) > foreach? ln -s $file > kmacy@freebird cd ../i386-xeno/conf/ > > Edit XENCONF, uncomment "options NFS_ROOT" and add the following: > > options BOOTP > options BOOTP_NFSROOT > options BOOTP_COMPAT > > As I had some issues compiling agp kernel modules I didn''t need I suggest > you > edit /etc/make.conf and add ''NO_MODULES="YES"'' > > # create compile directory > kmacy@freebird config XENCONF > Kernel build directory is ../compile/XENCONF > Don''t forget to do a ``make depend'''' > kmacy@freebird cd ../../include/ > # link in xen interface headers > kmacy@freebird ln -s <PATH to your XEN source>/xen/include/public > hypervisor-ifs > kmacy@freebird cd ../compile/XENCONF > kmacy@freebird make kernel-depend > # build kernel > kmacy@freebird make -j4 kernel > <...> > linking kernel.debug > text data bss dec hex filename > 2057881 135964 179472 2373317 2436c5 kernel.debug > objcopy --strip-debug kernel.debug kernel > > The kernel you get is only realy any good for diskless use but needs no > extra > kenv arguments passed to it. It will pick up NFS server and path from a > DHCP > or BOOTP server. (i.e. you can comment out all the ''extra'' string > definitions > in freebsd.phy >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users