FC5/Xen LVM resize question
by Heinz Deinhart
Hi,
im playing around with Xen and FC5. There is one thing i dont get
working. When i resize a logical volume in dom0 with lvextend, and
this volume is used and mounted in a domU, it seems that the domU does
not notice the new size of the partition until rebooted. ext2online
does nothing, fdisk reports the old size.
Should this work somehow without rebooting the domU, or is this the
intended behavior?
I think, i could create a volume goup inside of a domU and add space
to the domU by adding new block devices and adding their space to the
volume group. But is this really a clever way of doing this, or are
there any easier ways?
Thanks a lot,
Heinz
--
Heinz Deinhart
heinz(a)nix.at
17 years, 11 months
Best Practice for backing up running Virtual Machines
by Christian Reiter
Hello!
I am wondering what's the best way to backup a running xen-domU.
I've just tried to simply copy the file of a file-backed domU while it
was running.
Surprisingly that was succesful, i didn't even get a filesystem error....
But i think that is not a reliable way for production servers.
What would you recommend to get reliable disaster recovery backups
of file-backed as well as partition-backed (raw partition or lvm
volumes) vms?
Mit freundlichen Grüßen, /// Kind Regards,
Christian Reiter
--
Christian Reiter ||| c.reiter(a)gmx.net
17 years, 11 months
problem to start xend and finding the list of domains running
by Prasad Varma Kalidindi S. S. M
I have installed xen 3.0 following FedoraXenQuickstart.
After booting it with xen enabled kernel
The machine configuration is
Linux localhost.localdomain 2.6.16-1.2111_FC5xen0 #1 SMP Thu May 4
21:51:32 EDT 2006 i686 i686 i386 GNU/Linux
Then I tried to check the installation by typing
# /usr/sbin/xm list
Result is
Error: Error connecting to xend: No such file or directory. Is xend
running?
Then I tried to run xend
/etc/rc.d/init.d/xend start
It gave nothing.
What is the problem ? plz send me some quick fixes.
With Regards
PRASAD VARMA
**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
17 years, 12 months
RE: [Fedora-xen] Can not boot vm guest rhel4 with smp kernel on FC5with vt enabled hardware (Intel)
by You, Yongkang
Hi Thomas,
EM64T machine can install and run either i386 or EM64T Xen.
There should be a bug and the same issue like yours about “VMX hugemem kernel has booting problem on EM64T SMP Xen0”.
The possible way is to remaking your VMX SMP kernel without hugemem supporting. :-(
I heard FC5 SMP VMX can works well on EM64T Xen0, but I didn’t try with it.
Frankly saying, SMP VMX is still not too stable now, it is under-tuning. Thanks for the trying and reporting!
Best Regards,
Yongkang (Kangkang) 永康
________________________________
From: thomas.vonsteiger(a)bluewin.ch [mailto:thomas.vonsteiger@bluewin.ch]
Sent: 2006年5月14日 22:36
To: You, Yongkang; fedora-xen(a)redhat.com
Subject: AW: [Fedora-xen] Can not boot vm guest rhel4 with smp kernel on FC5with vt enabled hardware (Intel)
Hi Yongkang,
acpi=1 and apic=1 is not working, it’s the same problem.
My Xen0 is IA32 FC5.
Hardware is Pentium D 930 with motherboard D955XBK with EM64T.
Is this a problem if i run i386 and not x86_64 ?
I get the same problem if I try to start Redhat 7.2, single core is running, smp core is not running.
regards,
Thomas
________________________________
Von: You, Yongkang [mailto:yongkang.you@intel.com]
Gesendet: Sonntag, 14. Mai 2006 02:04
An: thomas.vonsteiger(a)bluewin.ch; fedora-xen(a)redhat.com
Betreff: RE: [Fedora-xen] Can not boot vm guest rhel4 with smp kernel on FC5with vt enabled hardware (Intel)
Hi Thomas,
Did your Xen0 is EM64T (IA32E)?
Could you try with opening acpi=1 and apic=1 in the HVM config file.
Best Regards,
Yongkang (Kangkang) 永康
________________________________
From: fedora-xen-bounces(a)redhat.com [mailto:fedora-xen-bounces@redhat.com] On Behalf Of thomas.vonsteiger(a)bluewin.ch
Sent: 2006年5月13日 14:57
To: fedora-xen(a)redhat.com
Subject: [Fedora-xen] Can not boot vm guest rhel4 with smp kernel on FC5with vt enabled hardware (Intel)
Hi,
I have running rhel4 vm guest on fc5 on VT hardware.
Becose i can boot only with single core kernel 2.6.9-34.EL
If I try to boot kernel-smp 2.6.9-34.EL with vcpus 2, boot is hanging by..
“Uncompressing Linux … Ok, booting the kernel.”
There is no errors, no output on serial console.
Anyone see the same effect ?
I using this config:
# Automatically generated xen config file
name = "rhel4_2"
builder = "hvm"
memory = "256"
acpi = 0
apic = 0
pea = 0
vcpus = 2
disk = [ 'phy:/dev/datavg/xenRHEL4_2,ioemu:hda,w' ]
vif = [ 'type=ioemu,bridge=xenbr0,mac=00:16:3e:09:e8:e0' ]
on_reboot = 'restart'
on_crash = 'restart'
kernel = '/usr/lib/xen/boot/hvmloader'
device_model = '/usr/lib/xen/bin/qemu-dm'
#cdrom = '/archiv/iso/RHEL4-U3-i386-AS-disc1.iso'
boot = 'c'
sdl = 0 # use SDL for graphics
vnc = 1 # use VNC for graphics
vncviewer = 0 # spawn vncviewer by default
nographic = 0 # don't use graphics
serial='pty' # enable serial console
regards,
thomas
17 years, 12 months
xenguest-install.py issues
by Ashe Canvar
Hi all,
I am following the FC5 Xen install page. However my xenU installs do
not seem to work using the python script. What am I doing wrong ?
[root@medusa1 ~]# NM=m1b; export NM; /usr/sbin/xenguest-install.py -n
$NM -f /vmd/$NM/$NM.disk -s 5.1 -r 256 -l nfs:10.1.55.40:/mnt
Starting install...
Using config file "/etc/xen/m1b".
Error: Error creating domain: Kernel image does not exist:
/var/lib/xen/vmlinuz.oZFOHc
If your install has exited, you can restart your guest by running
'xm create -c m1b'. Otherwise, you can reconnect to the console
by running 'xm console m1b'
[root@medusa1 ~]# xm create -c m1b
Using config file "/etc/xen/m1b".
Traceback (most recent call last):
File "/usr/bin/pygrub", line 256, in ?
cf = get_config(file, isconfig)
File "/usr/bin/pygrub", line 139, in get_config
raise RuntimeError, "Unable to read filesystem"
RuntimeError: Unable to read filesystem
Error: Boot loader didn't return any data!
[root@medusa1 ~]#
[root@medusa1 ~]# uname -a
Linux medusa1 2.6.16-1.2080_FC5xen0 #1 SMP Tue Mar 28 04:13:51 EST
2006 i686 i686 i386 GNU/Linux
[root@medusa1 ~]# rpm -qa | grep -i xen
xen-3.0.1-4
kernel-xen0-2.6.16-1.2080_FC5
Thanks !
-ansh
17 years, 12 months
RE: [Fedora-xen] Can not boot vm guest rhel4 with smp kernel on FC5with vt enabled hardware (Intel)
by You, Yongkang
Hi Thomas,
Did your Xen0 is EM64T (IA32E)?
Could you try with opening acpi=1 and apic=1 in the HVM config file.
Best Regards,
Yongkang (Kangkang) 永康
________________________________
From: fedora-xen-bounces(a)redhat.com [mailto:fedora-xen-bounces@redhat.com] On Behalf Of thomas.vonsteiger(a)bluewin.ch
Sent: 2006年5月13日 14:57
To: fedora-xen(a)redhat.com
Subject: [Fedora-xen] Can not boot vm guest rhel4 with smp kernel on FC5with vt enabled hardware (Intel)
Hi,
I have running rhel4 vm guest on fc5 on VT hardware.
Becose i can boot only with single core kernel 2.6.9-34.EL
If I try to boot kernel-smp 2.6.9-34.EL with vcpus 2, boot is hanging by..
“Uncompressing Linux … Ok, booting the kernel.”
There is no errors, no output on serial console.
Anyone see the same effect ?
I using this config:
# Automatically generated xen config file
name = "rhel4_2"
builder = "hvm"
memory = "256"
acpi = 0
apic = 0
pea = 0
vcpus = 2
disk = [ 'phy:/dev/datavg/xenRHEL4_2,ioemu:hda,w' ]
vif = [ 'type=ioemu,bridge=xenbr0,mac=00:16:3e:09:e8:e0' ]
on_reboot = 'restart'
on_crash = 'restart'
kernel = '/usr/lib/xen/boot/hvmloader'
device_model = '/usr/lib/xen/bin/qemu-dm'
#cdrom = '/archiv/iso/RHEL4-U3-i386-AS-disc1.iso'
boot = 'c'
sdl = 0 # use SDL for graphics
vnc = 1 # use VNC for graphics
vncviewer = 0 # spawn vncviewer by default
nographic = 0 # don't use graphics
serial='pty' # enable serial console
regards,
thomas
17 years, 12 months
Install of guest
by Jon Griffin
Is there a site that actually explains how to setup a guest? The page at
http://fedoraproject.org/wiki/FedoraXenQuickstartFC5#head-51f62872ad12e00...,
seems to assume you know how to setup the disk image.
I installed the kernels
kernel-xenU-2.6.16-1.2096_FC5
kernel-xen0-2.6.16-1.2111_FC5
xen-3.0.1-4
kernel-xenU-2.6.16-1.2111_FC5
kernel-xen0-2.6.16-1.2096_FC5
But don't understand about making the actual install location asked for
in xenguest-install.py
I am coming from a lot of years on gentoo, so my knowledge of fedora is
minimal.
17 years, 12 months
Can not boot vm guest rhel4 with smp kernel on FC5 with vt enabled hardware (Intel)
by Thomas von Steiger
Hi,
I have running rhel4 vm guest on fc5 on VT hardware.
Becose i can boot only with single core kernel 2.6.9-34.EL
If I try to boot kernel-smp 2.6.9-34.EL with vcpus 2, boot is hanging by..
"Uncompressing Linux . Ok, booting the kernel."
There is no errors, no output on serial console.
Anyone see the same effect ?
I using this config:
# Automatically generated xen config file
name = "rhel4_2"
builder = "hvm"
memory = "256"
acpi = 0
apic = 0
pea = 0
vcpus = 2
disk = [ 'phy:/dev/datavg/xenRHEL4_2,ioemu:hda,w' ]
vif = [ 'type=ioemu,bridge=xenbr0,mac=00:16:3e:09:e8:e0' ]
on_reboot = 'restart'
on_crash = 'restart'
kernel = '/usr/lib/xen/boot/hvmloader'
device_model = '/usr/lib/xen/bin/qemu-dm'
#cdrom = '/archiv/iso/RHEL4-U3-i386-AS-disc1.iso'
boot = 'c'
sdl = 0 # use SDL for graphics
vnc = 1 # use VNC for graphics
vncviewer = 0 # spawn vncviewer by default
nographic = 0 # don't use graphics
serial='pty' # enable serial console
regards,
thomas
17 years, 12 months
Problem starting Xen guest From SSH - Fedora5
by sicurezza@virtualsolution.net
Hi all,
When i start xen guest from console all is OK but
i have this error if i try to start from SSH:
[root@fedora bin]# /usr/sbin/xm create -c virtual7
Using config file "/etc/xen/virtual7".
Traceback (most recent call last):
File "/usr/bin/pygrub", line 258, in ?
curses.wrapper(run_main)
File "/usr/lib/python2.4/curses/wrapper.py", line 44, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/bin/pygrub", line 214, in run_main
sel = main(cf)
File "/usr/bin/pygrub", line 162, in main
(stdscr, win) = draw_window()
File "/usr/bin/pygrub", line 33, in draw_window
curses.use_default_colors()
_curses.error: use_default_colors() returned ERR
Error: Boot loader didn't return any data!
Any Ideas ?
Thanks
This is my envirorment:
OS: Fedora core 5
XEN version:
Name : xen Relocations: (not relocatable)
Version : 3.0.2 Vendor: Red Hat, Inc.
Release : 0.FC5.1 Build Date: gio 04 mag 2006 17:27:42 CEST
Install Date: ven 12 mag 2006 18:45:01 CEST Build Host: hs20-bc1-5.build.redhat.com
Group : Development/Libraries Source RPM: xen-3.0.2-0.FC5.1.src.rpm
Size : 3903916 License: GPL
Signature : DSA/SHA1, gio 04 mag 2006 19:03:45 CEST, Key ID da84cbd430c9ecf8
Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
URL : http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html
Kernel version:
kernel-xen0-2.6.16-1.2096_FC5.i686.rpm
Kernel guest version: 2.6.15-1.2054_FC5xenU
---------------------------------------------------------------------------------
[root@fedora bin]# cat /usr/bin/pygrub
#!/usr/bin/python
#
# pygrub - simple python-based bootloader for Xen
#
# Copyright 2005 Red Hat, Inc.
# Jeremy Katz <katzj(a)redhat.com>
#
# This software may be freely redistributed under the terms of the GNU
# general public license.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
import os, sys, string, struct, tempfile
import logging
import curses, _curses, curses.wrapper
import getopt
sys.path = [ '/usr/lib/python' ] + sys.path
import grub.GrubConf
import grub.fsys
PYGRUB_VER = 0.3
def draw_window():
stdscr = curses.initscr()
if hasattr(curses, 'use_default_colors'):
curses.use_default_colors()
try:
curses.curs_set(0)
except _curses.error:
pass
stdscr.addstr(1, 4, "pyGRUB version %s" %(PYGRUB_VER,))
win = curses.newwin(10, 74, 2, 1)
win.box()
win.refresh()
stdscr.addstr(12, 5, "Use the U and D keys to select which entry is highlighted.")
stdscr.addstr(13, 5, "Press enter to boot the selected OS. 'e' to edit the")
stdscr.addstr(14, 5, "commands before booting, 'a' to modify the kernel arguments ")
stdscr.addstr(15, 5, "before booting, or 'c' for a command line.")
stdscr.addch(12, 13, curses.ACS_UARROW)
stdscr.addch(12, 19, curses.ACS_DARROW)
(y, x) = stdscr.getmaxyx()
stdscr.move(y - 1, x - 1)
stdscr.refresh()
return (stdscr, win)
def fill_entries(win, cfg, selected):
y = 0
for i in cfg.images:
if (0, y) > win.getmaxyx():
break
if y == selected:
attr = curses.A_REVERSE
else:
attr = 0
win.addstr(y + 1, 2, i.title.ljust(70), attr)
y += 1
win.refresh()
def select(win, line):
win.attron(curses.A_REVERSE)
win.redrawln(line + 1, 1)
win.refresh()
def is_disk_image(file):
fd = os.open(file, os.O_RDONLY)
buf = os.read(fd, 512)
os.close(fd)
if len(buf) >= 512 and struct.unpack("H", buf[0x1fe: 0x200]) == (0xaa55,):
return True
return False
SECTOR_SIZE=512
def get_active_offset(file):
"""Find the offset for the start of the first active partition in the
disk image file."""
fd = os.open(file, os.O_RDONLY)
buf = os.read(fd, 512)
for poff in (446, 462, 478, 494): # partition offsets
# active partition has 0x80 as the first byte
if struct.unpack("<c", buf[poff:poff+1]) == ('\x80',):
return struct.unpack("<L", buf[poff+8:poff+12])[0] * SECTOR_SIZE
return -1
def get_config(fn, isconfig = False):
if not os.access(fn, os.R_OK):
raise RuntimeError, "Unable to access %s" %(fn,)
cf = grub.GrubConf.GrubConfigFile()
if isconfig:
# set the config file and parse it
cf.filename = fn
cf.parse()
return cf
offset = 0
if is_disk_image(fn):
offset = get_active_offset(fn)
if offset == -1:
raise RuntimeError, "Unable to find active partition on disk"
# open the image and read the grub config
fs = None
for fstype in grub.fsys.fstypes.values():
if fstype.sniff_magic(fn, offset):
fs = fstype.open_fs(fn, offset)
break
if fs is not None:
grubfile = None
for f in ("/boot/grub/menu.lst", "/boot/grub/grub.conf",
"/grub/menu.lst", "/grub/grub.conf"):
if fs.file_exist(f):
grubfile = f
break
if grubfile is None:
raise RuntimeError, "we couldn't find /boot/grub{menu.lst,grub.conf} " + \
"in the image provided. halt!"
f = fs.open_file(grubfile)
buf = f.read()
f.close()
fs.close()
# then parse the grub config
cf.parse(buf)
else:
raise RuntimeError, "Unable to read filesystem"
return cf
def get_entry_idx(cf, entry):
# first, see if the given entry is numeric
try:
idx = string.atoi(entry)
return idx
except ValueError:
pass
# it's not, now check the labels for a match
for i in range(len(cf.images)):
if entry == cf.images[i].title:
return i
return None
def main(cf = None):
mytime = 0
timeout = int(cf.timeout)
(stdscr, win) = draw_window()
stdscr.timeout(1000)
selected = cf.default
while (timeout == -1 or mytime < int(timeout)):
if timeout != -1 and mytime != -1:
stdscr.addstr(20, 5, "Will boot selected entry in %2d seconds"
%(int(timeout) - mytime))
else:
stdscr.addstr(20, 5, " " * 80)
fill_entries(win, cf, selected)
c = stdscr.getch()
if mytime != -1:
mytime += 1
# if c == ord('q'):
# selected = -1
# break
if c == ord('c'):
# FIXME: needs to go to command line mode
continue
elif c == ord('a'):
# FIXME: needs to go to append mode
continue
elif c == ord('e'):
# FIXME: needs to go to edit mode
continue
elif c in (curses.KEY_ENTER, ord('\n'), ord('\r')):
break
elif c == curses.KEY_UP:
mytime = -1
selected -= 1
elif c == curses.KEY_DOWN:
mytime = -1
selected += 1
else:
pass
# bound at the top and bottom
if selected < 0:
selected = 0
elif selected >= len(cf.images):
selected = len(cf.images) - 1
if selected >= 0:
return selected
if __name__ == "__main__":
sel = None
def run_main(scr, *args):
global sel
sel = main(cf)
def usage():
print >> sys.stderr, "Usage: %s [-q|--quiet] [--output=] [--entry=] <image>" %(sys.argv[0],)
try:
opts, args = getopt.gnu_getopt(sys.argv[1:], 'qh::',
["quiet", "help", "output=", "entry=",
"isconfig"])
except getopt.GetoptError:
usage()
sys.exit(1)
if len(args) < 1:
usage()
sys.exit(1)
file = args[0]
output = None
entry = None
interactive = True
isconfig = False
for o, a in opts:
if o in ("-q", "--quiet"):
interactive = False
elif o in ("-h", "--help"):
usage()
sys.exit()
elif o in ("--output",):
output = a
elif o in ("--entry",):
entry = a
# specifying the entry to boot implies non-interactive
interactive = False
elif o in ("--isconfig",):
isconfig = True
if output is None or output == "-":
fd = sys.stdout.fileno()
else:
fd = os.open(output, os.O_WRONLY)
cf = get_config(file, isconfig)
if interactive:
curses.wrapper(run_main)
else:
sel = cf.default
# set the entry to boot as requested
if entry is not None:
idx = get_entry_idx(cf, entry)
if idx is not None and idx > 0 and idx < len(cf.images):
sel = idx
img = cf.images[sel]
print "Going to boot %s" %(img.title)
print " kernel: %s" %(img.kernel[1],)
if img.initrd:
print " initrd: %s" %(img.initrd[1],)
offset = 0
if is_disk_image(file):
offset = get_active_offset(file)
if offset == -1:
raise RuntimeError, "Unable to find active partition on disk"
# read the kernel and initrd onto the hostfs
fs = None
for fstype in grub.fsys.fstypes.values():
if fstype.sniff_magic(file, offset):
fs = fstype.open_fs(file, offset)
break
if fs is None:
raise RuntimeError, "Unable to open filesystem"
kernel = fs.open_file(img.kernel[1],).read()
(tfd, fn) = tempfile.mkstemp(prefix="vmlinuz.", dir="/var/lib/xen")
os.write(tfd, kernel)
os.close(tfd)
sxp = "linux (kernel %s)" %(fn,)
if img.initrd:
initrd = fs.open_file(img.initrd[1],).read()
(tfd, fn) = tempfile.mkstemp(prefix="initrd.", dir="/var/lib/xen")
os.write(tfd, initrd)
os.close(tfd)
sxp += "(ramdisk %s)" %(fn,)
else:
initrd = None
sxp += "(args '%s')" %(img.args,)
sys.stdout.flush()
os.write(fd, sxp)
---------------------------------------------------------------------------------
17 years, 12 months
xenguest-install.py, DomU network fails
by Riaan van Niekerk
I am trying to install FC5 xen guests in a FC5 host, but it looks as if
networking fails to come up.
relevant info:
- Centrino M laptop
- install tree is also on laptop
I tried the installtree over NFS and HTTP, with the following commandlines
and
error messages:
xenguest-install.py -n vm1 -f /d/vm/vm1.vmdk -s 2 -r 256 -l
http://192.168.3.35/5 -x "lang=en_US.UTF-8 keymap=us ip=192.168.3.39 vnc"
/5/Fedora/base/stage2.img: Failed to connect to HTTP server
and
Unable to retrieve http://192.168.3.35/5/Fedora/base/stage2.img: Failed
(I can wget the file from the host though)
xenguest-install.py -n vm1 -f /d/vm/vm1.vmdk -s 2 -r 256 -l
nfs:192.168.3.35:/data/fc/5/ -x "lang=en_US.UTF-8 keymap=us
ip=192.168.3.39 vnc"
That directory could not be mounted from the server.
in the apache logs, I can see that the host, .35 is downloading
images/xen/vmlinuz and images/xen/initrd.img but there is nothing in the
logs which show that .39 comes up and tries to get stage2.img
I have to assume that the interface in DomU does not come up correctly
and no IP is assigned to this interface. Bridging looks correct:
how
bridge name bridge id STP enabled interfaces
xenbr0 8000.feffffffffff no peth0
vif0.0
vif1.0
Any ideas on how to fix/troubleshoot this further?
Also, does anyone know how to install off a CD-ROM image? the
file /usr/sbin/xenguest-install.py has references to cdrom but I see no
way to point the installer at anything but nfs, ftp or http.
TIA
Riaan
17 years, 12 months