Hi,
(Apoloises for earlier false send)
Host: CentOS 5.5
Guest: Ubuntu - maverick on LVM Volume
With Debian Installer specific variables
I am having a horrid time trying to create a guest on my host. I have
tried several method but they all fail for one reason or another. I
have had the most success with `xm create` but the problem I have with
`xm create` is that once the installation process is over and I am
asked to reboot, the dom no longer apepars in `xm list`.
Here is how I have created the guest, the config file is below:
xm create -c myconf.cfg install=true
install-mirror=http://mirror.bytemark.co.uk/ubuntu/
install-suite=maverick
While the guest OS is being installed, I can see it:
Name ID Mem(MiB) VCPUs State Time(s)
Domain-0 0 21880 24 r----- 2485.6
test-03 8 10240 1 -b---- 498.0
When the OS install is complete, I get the message: "Installation is
complete, so it is time to boot into your new system.". I press
continue, the OS shutdown but rather than staying in the xm list as
Shutdown, it does not appear on the list.
If I try `xm create myconf.cfg -c`, I get:
xm create -c myconf.cfg
Using config file "/etc/xen/myconf.cfg".
Error: Bootloader isn't executable
I move past this error by editing my config and making giving the path
to pygrub (bootloader = '/usr/bin/pygrub')
But then I get this traceback:
[root@vega ~]# xm create -c myconf.cfg
Using config file "/etc/xen/myconf".
Traceback (most recent call last):
File "/usr/bin/pygrub", line 682, in ?
chosencfg = run_grub(file, entry, fs)
File "/usr/bin/pygrub", line 536, in run_grub
g = Grub(file, fs)
File "/usr/bin/pygrub", line 203, in __init__
self.read_config(file, fs)
File "/usr/bin/pygrub", line 397, in read_config
raise RuntimeError, "couldn't find bootloader config file in the
image provided."
RuntimeError: couldn't find bootloader config file in the image provided.
No handlers could be found for logger "xend"
Error: Boot loader didn't return any data!
I then run pygrub directly on the VM
#pygrub /dev/mapper/VM-live--03--disk
Traceback (most recent call last):
File "/usr/bin/pygrub", line 682, in ?
chosencfg = run_grub(file, entry, fs)
File "/usr/bin/pygrub", line 536, in run_grub
g = Grub(file, fs)
File "/usr/bin/pygrub", line 203, in __init__
self.read_config(file, fs)
File "/usr/bin/pygrub", line 397, in read_config
raise RuntimeError, "couldn't find bootloader config file in the
image provided."
RuntimeError: couldn't find bootloader config file in the image provided.
Can anyone offer any advice on why the the dom is not visible after
the VM has been created or how I can get past this (py)grub problem?
Thanks in advance,
Dp.
==== myconf.cfg =====
#
# Configuration file for the Xen instance spl-live-03, created
# by xen-tools 4.2 on Fri Nov 5 11:04:33 2010.
#
# Kernel + memory size
#
#bootloader = '/usr/bin/pygrub'
vcpus = '1'
memory = '10240'
# Disk device(s).
#
root = '/dev/xvda1 ro'
disk = [
'phy:/dev/VM/spl-live-03-disk,xvda,w',
]
#
# Physical volumes
#
#
# Hostname
#
name = 'spl-live-03'
#
# Networking
#
dhcp = 'dhcp'
vif = [ 'mac=00:16:3E:1E:65:85' ]
#
# Behaviour
#
on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'restart'
# Debian Installer specific variables
def check_bool(name, value):
value = str(value).lower()
if value in ('t', 'tr', 'tru', 'true'):
return True
return False
global var_check_with_default
def var_check_with_default(default, var, val):
if val:
return val
return default
xm_vars.var('install', use='Install Debian, default: false', check=check_bool)
xm_vars.var("install-method",
use='Installation method to use "cdrom" or "network"
(default: network)',
check=lambda var, val: var_check_with_default('network', var, val))
# install-method == "network"
xm_vars.var("install-mirror",
use='Debian mirror to install from (default:
http://archive.ubuntu.com/ubuntu)',
check=lambda var, val:
var_check_with_default('http://archive.ubuntu.com/ubuntu', var, val))
xm_vars.var("install-suite",
use='Debian suite to install (default: maverick)',
check=lambda var, val: var_check_with_default('maverick', var, val))
# install-method == "cdrom"
xm_vars.var("install-media",
use='Installation media to use (default: None)',
check=lambda var, val: var_check_with_default(None, var, val))
xm_vars.var("install-cdrom-device",
use='Installation media to use (default: xvdd)',
check=lambda var, val: var_check_with_default('xvdd', var, val))
# Common options
xm_vars.var("install-arch",
use='Debian mirror to install from (default: amd64)',
check=lambda var, val: var_check_with_default('amd64', var, val))
xm_vars.var("install-extra",
use='Extra command line options (default: None)',
check=lambda var, val: var_check_with_default(None, var, val))
xm_vars.var("install-installer",
use='Debian installer to use (default: network uses
install-mirror; cdrom uses /install.ARCH)',
check=lambda var, val: var_check_with_default(None, var, val))
xm_vars.var("install-kernel",
use='Debian installer kernel to use (default: uses
install-installer)',
check=lambda var, val: var_check_with_default(None, var, val))
xm_vars.var("install-ramdisk",
use='Debian installer ramdisk to use (default: uses
install-installer)',
check=lambda var, val: var_check_with_default(None, var, val))
xm_vars.check()
if not xm_vars.env.get('install'):
bootloader="pygrub"
elif xm_vars.env['install-method'] == "network":
import os.path
print "Install Mirror: %s" % xm_vars.env['install-mirror']
print "Install Suite: %s" % xm_vars.env['install-suite']
if xm_vars.env['install-installer']:
installer = xm_vars.env['install-installer']
else:
installer =
xm_vars.env['install-mirror']+"/dists/"+xm_vars.env['install-suite'] +
\
"/main/installer-"+xm_vars.env['install-arch']+"/current/images"
print "Installer: %s" % installer
print
print "WARNING: Installer kernel and ramdisk are not authenticated."
print
if xm_vars.env.get('install-kernel'):
kernelurl = xm_vars.env['install-kernel']
else:
kernelurl = installer + "/netboot/xen/vmlinuz"
if xm_vars.env.get('install-ramdisk'):
ramdiskurl = xm_vars.env['install-ramdisk']
else:
ramdiskurl = installer + "/netboot/xen/initrd.gz"
import urllib
class MyUrlOpener(urllib.FancyURLopener):
def http_error_default(self, req, fp, code, msg, hdrs):
raise IOError("%s %s" % (code, msg))
urlopener = MyUrlOpener()
try:
print "Fetching %s" % kernelurl
kernel, _ = urlopener.retrieve(kernelurl)
print "Fetching %s" % ramdiskurl
ramdisk, _ = urlopener.retrieve(ramdiskurl)
except IOError, _:
raise
elif xm_vars.env['install-method'] == "cdrom":
arch_path = { 'i386': "/install.386",
'amd64': "/install.amd" }
if xm_vars.env['install-media']:
print "Install Media: %s" % xm_vars.env['install-media']
else:
raise OptionError("No installation media given.")
if xm_vars.env['install-installer']:
installer = xm_vars.env['install-installer']
else:
installer = arch_path[xm_vars.env['install-arch']]
print "Installer: %s" % installer
if xm_vars.env.get('install-kernel'):
kernelpath = xm_vars.env['install-kernel']
else:
kernelpath = installer + "/xen/vmlinuz"
if xm_vars.env.get('install-ramdisk'):
ramdiskpath = xm_vars.env['install-ramdisk']
else:
ramdiskpath = installer + "/xen/initrd.gz"
disk.insert(0, 'file:%s,%s:cdrom,r' % (xm_vars.env['install-media'],
xm_vars.env['install-cdrom-device']))
bootloader="/usr/bin/pygrub"
bootargs="--kernel=%s --ramdisk=%s" % (kernelpath, ramdiskpath)
print "From CD"
else:
print "WARNING: Unknown install-method: %s." % xm_vars.env['install-method']
if xm_vars.env.get('install'):
# Figure out command line
if xm_vars.env['install-extra']:
extras=[xm_vars.env['install-extra']]
else:
extras=[]
# Reboot will just restart the installer since this file is not
# reparsed, so halt and restart that way.
extras.append("debian-installer/exit/always_halt=true")
extras.append("--")
extras.append("quiet")
console="hvc0"
try:
if len(vfb) >= 1:
console="tty0"
except NameError, e:
pass
extras.append("console="+ console)
extra = str.join(" ", extras)
print "command line is \"%s\"" % extra
======================
_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users
|