Bryan Kearney | 28 Aug 18:44

replacing a file under kvm

I know you should not do this, but I am just curious. Assume I have a 
virtual machine running (git appliance) and I rebuild the image, thus 
replacing on the file system the backing for the machine I see in 
virt-manager. If I destroy the machine via virt-manager has it attempted 
to write bits to the underliing file?

-- bk
Harry Hoffman | 28 Aug 13:41

Sysdirector

Hi,

Just stumbled across this and was wondering if the RH/Fedora folk have 
come across this and whether or not it fits up with Spacewalk, Cobbler, 
Func., etc.

http://www.sysdirector.org/

Cheers,
Harry
Mark Chaney | 23 Aug 23:24

domu list?


Where virt-manager stores its xml file list of domu's it administrates? I
need to change some paths and also add some domu's that I have imported.

Thanks,
Mark
Boris Altshul | 21 Aug 01:21

looks like a bug in LiveCdInstaller.py

I was trying to use some of my virsh based scripts on Fedora 9 and ran into problems. After some debugging, it looks like that
there is an issue with passing the parameter "os_type" to the base class from LiveCdInstaller constructor. Take a look.
 
In LiveCdInstaller.py
-----------------------

class LiveCDInstaller(Guest.Installer):
    def __init__(self, type = "xen", location = None, os_type = None):
        Guest.Installer.__init__(self, type, location, os_type = None)
--------------------------------------------
Should be

class LiveCDInstaller(Guest.Installer):
    def __init__(self, type = "xen", location = None, os_type = None):
                                                            -------V   
        Guest.Installer.__init__(self, type, location, os_type=os_type)

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@...
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
Cole Robinson | 15 Aug 02:59

[PATCH] virt-manager: Option to add sound device for vm create

The attached patch adds options to virt-manager's preferences
section for adding an audio device to new VMs.

The new option defaults to adding audio for all new local
VMs, but skipping audio for remote VMs.

I opted for the preferences screen approach since it seems
like the type of thing users will either always or never
want, and the new VM wizard is kind of cluttered as it is.

Couple of screenshots:

http://fedorapeople.org/~crobinso/virt-manager/virt-manager-sound-prefs.png
http://fedorapeople.org/~crobinso/virt-manager/virt-manager-sound-summary.png

Thanks,
Cole
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@...
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
Michael DeHaan | 14 Aug 23:30

Installing RHEL 2 (yes, "*2*") inside a F9 KVM VM...

I'm finding that RHEL 2 (last dot release) does not seem to have a 
virtual NIC of the type that Anaconda can discover.

Has anyone tested EL2, and if so, should I be sending something extra 
down to python virtinst for that?

--Michael
Guido Günther | 14 Aug 10:17

[patch] set correct mac type on virt-clone

Hi,
attached is a patch that sets the correct mac address type when using
virt-clone. It continues to use the Xen prefix for unknown hypervisors
but uses the correct one for kvm/qemu. I also added some doctest.

virt-image/virt-inst still need to be fixed up at a later point.
Cheers,
 -- Guido
Attachment (mac-prefix.diff): text/x-diff, 2742 bytes
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@...
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
Ben Riggs | 13 Aug 18:55

Missing? dependency for remote virt-manager on fc9

After a 'yum groupinstall virtualization' on a fresh fc9 install, 
calling virt-manager via ssh (w/ x-forwarding) does nothing. When 
calling virt-viewer, it reported a missing library. We traced the 
library to the package mesa-libGLU. After installing this pacakge via 
yum, virt-manager worked as expected.

Thanks,
Ben
Cole Robinson | 13 Aug 02:17

[PATCH] virtinst: add storage builders for logical pools and volumes

The attached patch adds virtinst support for building
logical pools and volumes. Sort of. This will allow
creating new volumes, but not creating pools (aka
volume groups) from a specified set of physical disks.
I believe libvirt supports this, but I haven't tried it
yet.

However this does allow the user to point at an existing
lvm volume group and have it recognized as a storage pool
which will be by far the common case. The nice thing
about this is that it will all become immediately available
in the virt-manager UI (posted previously).

One thing I've encountered with this though: does a volume's
target path have any significance upon creation? File volumes
just seem to create a file based on the passed 'name', not
target path. Disk volumes ignore both when creating. Logical
vols also only use the name, but try to validate the target
path after creation, which we shouldn't need passed (the result
should simply be vgpath + "/" + volname). So it seems like
target path has no real meaning when defining a volume. Am
I missing something?

Thanks,
Cole

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@...
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
Cole Robinson | 12 Aug 23:05

[PATCH] virt-install cli options for managed storage

Per Dan's advice, I've changed the previously proposed
virt-install cli options for specifying libvirt managed
storage.

This patch does not change any possible semantics of
--file or --cdrom: they remain strictly for specifying
local media. In this way they are basically deprecated.

A new cli option is added: --disk. The format is:

--disk  path:///some/file/path[:device=cdrom|floppy][:permissions=ro|sh]
--disk  vol:///poolname/volname[:device=cdrom|floppy][:permissions=ro|sh]
--disk  pool:///poolname[:device=cdrom|floppy][:permissions=ro|sh]

The changes from Dan's proposal are:

 - use of path:/// instead of file:///, since this will
   hopefully clear up any confusion users previously had
   with specifying block devices.
 - For vol:///, I used / as a delimiter vs. ':' between
   the pool and vol name, to avoid any extra collisions
   (since I assume '/' is not part of a legal pool name).
 - Explictly list what type of extra option we are
   appending (device, permissions). This adds clarity
   to the command line, reduces chance of name collision,
   and is similar to the approach used by qemu.

The --disk option is quite useful even for the local case,
since users can now add cdrom and floppy drives (and eventually
other device types) via the cli. This could also be expanded
to allow specifying file formats (qcow2, etc.) for creating
new storage.

The other functionality change is that disk:/// can be used
to specify install media. If none of --pxe, --cdrom, or 
--location are specified, we look to see if a --disk 
device=cdrom was specified, and if so, use that for
installation. We can eventually expand this to allow
installing off floppies.

One question: Is ':' an appropriate delimiter? qemu typically
uses ',' for these types of cli options. May be an arbitrary
choice, but perhaps someone has an opinion.

There are some small changes in the patch to allow installers
to skip setting up an install cdrom if no 'location' is
specified, and just defering to the guests disks. The rest
of the change is centered in virt-install.

 virt-install                |  174 ++++++++++++++++++++++++++++++++++----------
 virtinst/DistroManager.py   |    6 +
 virtinst/LiveCDInstaller.py |   16 ++--
 3 files changed, 150 insertions(+), 46 deletions(-)

Thanks,
Cole

diff -r bd9e79483f70 virt-install
--- a/virt-install	Mon Aug 11 18:20:28 2008 -0400
+++ b/virt-install	Tue Aug 12 17:04:29 2008 -0400
@@ -44,26 +44,101 @@
 gettext.bindtextdomain(virtinst.gettext_app, virtinst.gettext_dir)
 gettext.install(virtinst.gettext_app, virtinst.gettext_dir, unicode=1)

-### General input gathering functions
-def get_disk(disk, size, sparse, guest, hvm, conn):
+def parse_disk_option(guest, path, size):
+    """helper to properly parse --disk options"""
+    abspath = None
+    voltuple = None
+    volinst = None
+    devtype = None
+    ro = False
+    shared = False

-    # Getting disk size
-    if not os.path.exists(disk) and size is None:
-        fail(_("Must specify size for non-existent disks"))
+    origpath = path
+
+    # Strip media type
+    if path.startswith("path:///"):
+        path_type = "path:///"
+    elif path.startswith("vol:///"):
+        path_type = "vol:///"
+    elif path.startswith("pool:///"):
+        path_type = "pool:///"
+    else:
+        fail(_("--disk path must start with path:///, pool:///, or vol:///."))
+    path = path[len(path_type):]
+
+    # Parse endings for permissions and device type
+    while True:
+        if not path.count(":"):
+            break
+        path, opts = path.split(":", 1)
+        for opt in opts.split(":"):
+            opt_type = None
+            opt_val = None
+            if opt.count("="):
+                opt_type, opt_val = opt.split("=", 1)
+            if opt_type == "device":
+                devtype = opt_val
+            elif opt_type == "permissions":
+                if opt_val == "ro":
+                    ro = True
+                elif opt_val == "sh":
+                    shared = True
+                else:
+                    fail(_("Unknown permissions value '%s'." % opt_val))
+            else:
+                fail(_("Unknown disk option '%s'." % opt))
+
+    # We return (path, (poolname, volname), volinst, device, readonly, shared)
+    if path_type == "path:///":
+        abspath = os.path.abspath(path)
+    elif path_type == "pool:///":
+        if not size:
+            raise ValueError(_("Size must be specified with all 'pool:///'"))
+        vc = virtinst.Storage.StorageVolume.get_volume_for_pool(pool_name=path,
+                                                                conn=guest.conn)
+        vname = virtinst.Storage.StorageVolume.find_free_name(conn=guest.conn,
+                                                              pool_name=path,
+                                                              name=guest.name)
+        volinst = vc(pool_name=path, name=vname, conn=guest.conn,
+                     capacity=(size and size*1024*1024*1024))
+    elif path_type == "vol:///":
+        if not path.count("/"):
+            raise ValueError(_("Storage volume must be specified as "
+                               "disk:///poolname/volname"))
+        vollist = path.split("/")
+        voltuple = (vollist[0], vollist[1])
+        logging.debug("Parsed volume: as pool='%s' vol='%s'" % \
+                      (voltuple[0], voltuple[1]))
+
+    if not devtype:
+        devtype = virtinst.VirtualDisk.DEVICE_DISK
+    ret = (abspath, voltuple, volinst, devtype, ro, shared)
+    logging.debug("parse_disk: returning %s" % str(ret))
+    return ret
+
+def get_disk(disk, size, sparse, guest, hvm, conn, is_file_path):
+
     try:
-        size = float(size)
-    except Exception, e:
-        fail(e)
+        # Get disk parameters
+        if is_file_path:
+            (path, voltuple, volinst,
+             device, readOnly, shared) = (disk, None, None,
+                                         virtinst.VirtualDisk.DEVICE_DISK,
+                                         False, False)
+        else:
+            (path, voltuple, volinst,
+             device, readOnly, shared) = parse_disk_option(guest, disk, size)

-    # Build disk object
-    try:
-        d = virtinst.VirtualDisk(disk, size, sparse = sparse)
+        d = virtinst.VirtualDisk(path=path, size=size, sparse=sparse,
+                                 volInstall=volinst, volName=voltuple,
+                                 readOnly=readOnly, device=device,
+                                 conn=guest.conn)
         # Default file backed PV guests to tap driver
         if d.type == virtinst.VirtualDisk.TYPE_FILE \
            and not(hvm) and virtinst.util.is_blktap_capable():
            d.driver_name = virtinst.VirtualDisk.DRIVER_TAP
     except ValueError, e:
-        fail(e)
+        fail(_("Error with storage parameters: %s" % str(e)))

     # Check disk conflicts
     if d.is_conflict_disk(conn) is True:
@@ -71,7 +146,7 @@
         if not cli.prompt_for_yes_or_no(warnmsg + _("Do you really want to use the disk (yes or no)? ")):
             cli.nice_exit()

-    ret = d.size_conflict()
+    ret = d.is_size_conflict()
     if ret[0]:
         fail(ret[1])
     elif ret[1]:
@@ -80,11 +155,19 @@

     guest.disks.append(d)

-def get_disks(disk, size, sparse, nodisks, guest, hvm, conn):
+def get_disks(file_paths, disk_paths, size, sparse, nodisks, guest, hvm, conn):
     if nodisks:
-        if disk or size:
-            fail(_("Cannot use --file with --nodisks"))
+        if file_paths or disk_paths or size:
+            fail(_("Cannot use --file, --size, or --disk with --nodisks"))
         return
+    if file_paths and disk_paths:
+        fail(_("Cannot mix --file and --disk options."))
+    elif not file_paths and not disk_paths:
+        fail(_("A disk must be specified (use --nodisks to override)"))
+
+    is_file_path = (file_paths or False)
+    disk = (file_paths or disk_paths)
+
     # ensure we have equal length lists
     if (type(disk) == type(size) == list):
         if len(disk) != len(size):
@@ -94,14 +177,11 @@
     elif type(size) == list:
         disk = [ None ] * len(size)

-    if (type(disk) == list):
-        map(lambda d, s: get_disk(d, s, sparse, guest, hvm, conn),
-            disk, size)
-    elif (type(size) == list):
-        map(lambda d, s: get_disk(d, s, sparse, guest, hvm, conn),
-            disk, size)
+    if type(disk) == list or type(size) == list:
+        map(lambda d, s: get_disk(d, s, sparse, guest, hvm, conn,
+                                  is_file_path), disk, size)
     else:
-        get_disk(disk, size, sparse, guest, hvm, conn)
+        get_disk(disk, size, sparse, guest, hvm, conn, is_file_path)

 def get_networks(macs, bridges, networks, guest):
     (macs, networks) = cli.digest_networks(macs, bridges, networks)
@@ -128,22 +208,34 @@
         if location is None:
             fail(_("location must be specified for paravirtualized guests."))

-    if not (pxe or location or cdpath):
-        fail(_("One of --pxe, --location or --cdrom must be specified."))
+    if location and virtinst.util.is_uri_remote(guest.conn.getURI()):
+        fail(_("--location can not be specified for remote connections."))
+
+    cdinstall = (cdpath or False)
+    if not (pxe or cdpath or location):
+        # Look at Guest disks: if there is a cdrom, use for install
+        for disk in guest.disks:
+            if disk.device == virtinst.VirtualDisk.DEVICE_CDROM:
+                cdinstall = True
+        if not cdinstall:
+            fail(_("One of --pxe, --location, or cdrom media must be "
+                    "specified."))
     if pxe:
         return
     try:
-        # guest.cdrom is deprecated
-        guest.location = (location or cdpath)
+        if location or cdpath:
+            guest.location = (location or cdpath)
         if cdpath and os.path.exists(cdpath):
             # Build a throwaway disk for validation for local CDs only
-            cddisk = virtinst.VirtualDisk(path=guest.location, 
+            cddisk = virtinst.VirtualDisk(path=cdpath,
+                                          conn=guest.conn,
                                           transient=True,
                                           device=virtinst.VirtualDisk.DEVICE_CDROM,
                                           readOnly=True)
+        if cdinstall:
             guest.installer.cdrom = True
     except ValueError, e:
-        fail(e)
+        fail(_("Error creating cdrom disk: %s" % str(e)))

 
 ### Option parsing
@@ -177,8 +269,12 @@

     # disk options
     parser.add_option("-f", "--file", type="string",
-                      dest="diskfile", action="callback", callback=cli.check_before_append,
+                      dest="file_path", action="callback", callback=cli.check_before_append,
                       help=_("File to use as the disk image"))
+    parser.add_option("", "--disk", type="string", dest="disk_path",
+                      action="callback", callback=cli.check_before_append,
+                      help=_("Specify storage to use as a disk with various "
+                             "options."))
     parser.add_option("-s", "--file-size", type="float",
                       action="append", dest="disksize",
                       help=_("Size of the disk image (if it doesn't exist) in gigabytes"))
@@ -337,7 +433,6 @@
     conn = cli.getConnection(options.connect)
     capabilities = virtinst.CapabilitiesParser.parse(conn.getCapabilities())

-
     if options.fullvirt and options.paravirt:
         fail(_("Can't do both --hvm and --paravirt"))

@@ -372,12 +467,14 @@
     logging.debug("Hypervisor type is '%s'" % type)

     if options.livecd:
-        installer = virtinst.LiveCDInstaller(type = type, os_type = os_type)
+        installer = virtinst.LiveCDInstaller(type = type, os_type = os_type,
+                                             conn = conn)
     elif options.pxe:
-        installer = virtinst.PXEInstaller(type = type, os_type = os_type)
+        installer = virtinst.PXEInstaller(type = type, os_type = os_type,
+                                          conn = conn)
     else:
-        installer = virtinst.DistroInstaller(type = type, os_type = os_type)
-
+        installer = virtinst.DistroInstaller(type = type, os_type = os_type,
+                                             conn = conn)

     if hvm:
         guest = virtinst.FullVirtGuest(connection=conn, installer=installer,
@@ -394,10 +491,9 @@
     if hvm:
         cli.get_sound(options.sound, guest)

-
     # set up disks
-    get_disks(options.diskfile, options.disksize, options.sparse, options.nodisks,
-              guest, hvm, conn)
+    get_disks(options.file_path, options.disk_path, options.disksize,
+              options.sparse, options.nodisks, guest, hvm, conn)

     # set up network information
     get_networks(options.mac, options.bridge, options.network, guest)
diff -r bd9e79483f70 virtinst/DistroManager.py
--- a/virtinst/DistroManager.py	Mon Aug 11 18:20:28 2008 -0400
+++ b/virtinst/DistroManager.py	Tue Aug 12 17:04:29 2008 -0400
@@ -258,7 +258,11 @@
         }

         if self.cdrom:
-            self._prepare_cdrom(guest, distro, meter)
+            if self.location:
+                self._prepare_cdrom(guest, distro, meter)
+            else:
+                # Booting from a cdrom directly allocated to the guest
+                pass
         else:
             self._prepare_kernel_and_initrd(guest, distro, meter)

diff -r bd9e79483f70 virtinst/LiveCDInstaller.py
--- a/virtinst/LiveCDInstaller.py	Mon Aug 11 18:20:28 2008 -0400
+++ b/virtinst/LiveCDInstaller.py	Tue Aug 12 17:04:29 2008 -0400
@@ -47,19 +47,23 @@
                 break

         if not found:
-            raise LiveCDInstallerException(_("HVM virtualisation not supported; cannot boot LiveCD"))
+            raise LiveCDInstallerException(_("Connection does not support HVM virtualisation, cannot boot live CD"))

         path = None
         vol_tuple = None
         if type(self.location) is tuple:
             vol_tuple = self.location
-        else:
+        elif self.location:
             path = self.location
+        elif not self.cdrom:
+            raise LiveCDInstallerException(_("CDROM media must be specified "
+                                             "for the live CD installer."))

-        disk = VirtualDisk(path=path, conn=guest.conn, volName=vol_tuple,
-                           device = VirtualDisk.DEVICE_CDROM,
-                           readOnly = True)
-        guest._install_disks.insert(0, disk)
+        if path or vol_tuple:
+            disk = VirtualDisk(path=path, conn=guest.conn, volName=vol_tuple,
+                               device = VirtualDisk.DEVICE_CDROM,
+                               readOnly = True)
+            guest._install_disks.insert(0, disk)

     def _get_osblob(self, install, hvm, arch = None, loader = None, conn = None):
         if install:
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@...
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
Niranjan M.R | 11 Aug 08:02

Error compiling virt-mem-2.8

Hi all,

I am using FC9 x86_64 and trying to install virt-mem-0.2.8, But i get 
below error when trying to do "make"

[root <at> dhcp7-90 virt-mem-0.2.8]# make
for d in lib uname dmesg ps mem extract/fedora-koji extract/codegen po; 
do \
         make -C $d all; \
         if [ $? -ne 0 ]; then exit 1; fi; \
       done
make[1]: Entering directory `/opt/virt-mem-0.2.8/lib'
ocamlfind ocamlc -dtypes -g -syntax bitstring.syntax -package 
unix,bigarray,extlib,libvirt,xml-light,bitstring.syntax -c 
virt_mem_gettext.ml
ocamlfind ocamlc -dtypes -g -syntax bitstring.syntax -package 
unix,bigarray,extlib,libvirt,xml-light,bitstring.syntax -c 
virt_mem_version.ml
ocamlfind ocamlc -dtypes -g -syntax bitstring.syntax -package 
unix,bigarray,extlib,libvirt,xml-light,bitstring.syntax -c 
virt_mem_utils.ml
gcc -g -O2 -Wall -Werror -I/usr/lib64/ocaml -I..   -c -o 
virt_mem_mmap_c.o virt_mem_mmap_c.c
ocamlfind ocamlc -dtypes -g -syntax bitstring.syntax -package 
unix,bigarray,extlib,libvirt,xml-light,bitstring.syntax -c virt_mem_mmap.ml
File "virt_mem_mmap.ml", line 1, characters 0-1:
Could not find the .cmi file for interface virt_mem_mmap.mli.
make[1]: *** [virt_mem_mmap.cmo] Error 2
make[1]: Leaving directory `/opt/virt-mem-0.2.8/lib'
make: *** [all] Error 1

Any ideas

Regards
Niranjan

Gmane