Re: [Libguestfs] libguestfs on PPC64
by Richard W.M. Jones
On Tue, Sep 10, 2013 at 10:08:21PM -0400, Britt Dodd wrote:
> Hypothetically speaking, could libguestfs be tweaked to run on ppc32 as
> well?
[Let's keep the replies on list]
Theoretically yes, although I've not tried it.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
10 years, 11 months
question about backing file path of a qcow2 image
by bigclouds
hi,all
images of qcow2 format with backing files, its backing files have two path infos (absolute path and relative path) ,how to let libguestfs use absolute path rather than relative path. in some case, this leads error.
thanks
10 years, 12 months
libguestfs on PPC64
by Richard W.M. Jones
[Note I'm not bothering with 32 bit ppc any more since it is
effectively obsolete.]
Libguestfs now works on ppc64 using the 'direct' backend. You will
need:
- libguestfs 1.23.21 + 7f90aa0998
- supermin 4.1.x (only tested with supermin-4.1.5-2.fc21.ppc64, but
earlier versions should work)
- qemu-system-ppc64 compiled from git (qemu 1.4 & 1.6 known to be broken)
- kernel-3.10.10-200.fc19.ppc64, earlier versions should work
- real ppc64 hardware
There are multiple bugs which stop you installing Fedora/ppc64 on
qemu-system-ppc64 running on x86-64.
Since Fedora 19 has dropped support for PR KVM, and since the Apple G5
I use for testing does not support real HV KVM, I could not test this
using KVM, only using TCG.
Next steps are:
- run the full test suite and fix any problems (in progress)
- get it working with the libvirt backend
All features should be fully supported except the UML backend won't
work (limitation of UML).
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
11 years
libguestfs on ARM
by Richard W.M. Jones
libguestfs now has experimental support for 32-bit ARM, including KVM
on ARM. You will need at least the following to make it all work:
- libguestfs 1.23.21 + 6e498461f6
Use ./configure --with-default-backend=direct. The libvirt backend
does not work (yet).
- supermin 4.1.5 + a55d9cf157
- kernel that supports virtio-mmio, virtio-scsi, virtio-serial
Note that the Fedora 20 kernel has missing virtio-serial support
(RHBZ#1005551) so you have to compile your own appliance kernel.
- qemu 1.6.0 or from git
To use KVM:
- Cortex-A15 hardware that boots into Hyp mode
- host kernel >= 3.11 with LPAE + KVM support
(You can also use regular ARM hardware w/o KVM support, or qemu.)
If you need different host and appliance kernels, then set
SUPERMIN_KERNEL to point to the appliance vmlinuz and SUPERMIN_DTB to
point to the device tree file called 'vexpress-v2p-ca9.dtb'. If host
kernel == appliance kernel (as on x86), then you shouldn't need to set
any environment variables.
It's expected that some tests in the libguestfs test suite will fail.
I'm working on fixing those. However the majority should run fine, as
should 'make quickcheck' (ie. libguestfs-test-tool) -- if
libguestfs-test-tool doesn't work then you're missing some dependency
above.
I'm also working on making the libvirt backend work.
The UML backend does not work on ARM (this is a limitation of UML).
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v
11 years
[PATCH supermin 0/2] helper: Implement device trees.
by Richard W.M. Jones
This two-part patch for supermin implements device trees (for ARM).
The first patch introduces a more rational way to handle command line
arguments in 'supermin-helper'. See the commit message for details.
The old style is still supported for compatibility.
The second patch adds an extra supermin-helper --dtb parameter
specifying a wildcard. A device tree file which matches the selected
kernel and this wildcard is linked to (or copied if --copy-kernel).
The intended use is from libguestfs (on ARM) which can now do:
supermin-helper -f ext2 --dtb 'vexpress-*a9.dtb' [etc]
which will create a 'dtb' file alongside kernel, initrd, etc in the
appliance directory. Qemu is invoked using:
qemu-system-arm -kernel kernel -dtb dtb [...]
(or the equivalent via libvirt).
Rich.
11 years
python-guestfs
by 徐展聪
I use python-guestfs to mount windows image it have some problems .Here is my code:
[root@mfsdata1 ~]# python
Python 2.6.6 (r266:84292, Sep 11 2012, 08:34:23)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> sheepfs_dir="/tmp/sheepfs"
>>> os.system("umount " + sheepfs_dir)
0
>>> os.system("sheepfs -n " + sheepfs_dir)
0
>>> vdi_name = "vm1935028.nbregion.ec2.cloudkc.cn"
>>> os.system("echo " + vdi_name + ">" + sheepfs_dir + "/vdi/mount")
0
>>> import guestfs
>>> g=guestfs.GuestFS()
>>> imgfile=sheepfs_dir + "/volume/" + vdi_name
>>> g.add_drive_opts(imgfile, format="raw", readonly=0)
>>> g.launch()
>>> root = g.inspect_os()
>>> print root
[]
>>> g.list_filesystems()
[('/dev/vda1', 'ntfs'), ('/dev/vda2', 'ntfs')]
11 years
[PATCH] virt-v2v: Add verbose message logging
by Mike Latimer
As a followup to the discussion on verbose logging for virt-v2v, this patch
adds basic verbose messages in the main virt-v2v code. As Matt pointed out,
the usefulness of these messages is limited as the time spent outside of data
copying is trivial. However, when converting smaller guests, these messages
can act as progress markers and show where time is being spent. (As I already
added this code for my testing, I thought it might be worth discussing further
here.)
This patch adds the following startup options:
-v | --verbose
Enables verbose messages logging
-vv
Verbose messages, plus sets LIBGUESTFS_TRACE=1
-vvv
Verbose messages, plus sets LIBGUESTFS_TRACE=1 and LIBGUESTFS_DEBUG=1
---
v2v/virt-v2v.pl | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl
index 3832f67..eddcd16 100755
--- a/v2v/virt-v2v.pl
+++ b/v2v/virt-v2v.pl
@@ -354,6 +354,24 @@ my $list_profiles = 0;
Display a list of target profile names specified in the configuration file.
+=cut
+
+my $verbose;
+
+=item B<-v | --verbose>
+
+Enable verbose message logging.
+
+=item B<-vv>
+
+Verbose messages, plus sets LIBGUESTFS_TRACE=1.
+
+=item B<-vvv>
+
+Verbose messages, plus sets LIBGUESTFS_TRACE=1 and LIBGUESTFS_DEBUG=1.
+
+=cut
+
=item B<--help>
Display brief help.
@@ -388,6 +406,16 @@ GetOptions ("help|?" => sub {
print "$Sys::VirtConvert::VERSION\n";
exit(0);
},
+ "v|verbose" => \$verbose,
+ "vv" => sub {
+ $verbose = 1;
+ $ENV{LIBGUESTFS_TRACE} = '1';
+ },
+ "vvv" => sub {
+ $verbose = 1;
+ $ENV{LIBGUESTFS_TRACE} = '1';
+ $ENV{LIBGUESTFS_DEBUG} = '1';
+ },
"c|connect" => sub {
# -c|--connect is the default for other virt tools. Be nice to
# the user and point out that virt-v2v is different.
@@ -521,6 +549,10 @@ else {
# Get an appropriate Source
my $source;
+if (defined($verbose)) {
+ logmsg NOTICE, __x('Connecting to input '.
+ '({input})', input => $input_method)
+}
if ($input_method eq "libvirtxml") {
my $path = shift(@ARGV) or
pod2usage({ -message => __"You must specify a filename",
@@ -574,6 +606,10 @@ else {
# Decide the name of the guest target.
$output_name = $source->get_name() unless defined $output_name;
+if (defined($verbose)) {
+ logmsg NOTICE, __x('Validating guest: {output}',
+ output => $output_name)
+}
# Check that the guest doesn't already exist on the target
v2vdie __x('Domain {name} already exists on the target.',
@@ -593,9 +629,14 @@ v2vdie __('Guest doesn\'t define any storage devices')
unless @{$meta->{disks}} > 0;
# Copy source storage to target
+if (defined($verbose)) {
+ logmsg NOTICE, __x('Copying virtual machine storage to target '.
+ '({output})', output => $output_method)
+}
$source->copy_storage($target, $output_format, $output_sparse);
# Open a libguestfs handle on the guest's storage devices
+if (defined($verbose)) { logmsg NOTICE, __x('Starting guestfs') }
my @disks = map { [ $_->{device},
$_->{dst}->get_path(),
$_->{dst}->get_format() ] } @{$meta->{disks}};
@@ -623,13 +664,17 @@ my $guestcaps;
my $root;
eval {
# Inspect the guest
+ if (defined($verbose)) { logmsg NOTICE, __x('Inspecting guest') }
$root = inspect_guest($g, $transferdev);
# Modify the guest and its metadata
+ if (defined($verbose)) { logmsg NOTICE, __x('Converting guest') }
$guestcaps =
Sys::VirtConvert::Converter->convert($g, $config, $root, $meta,
\%options);
+ # Create the guest
+ if (defined($verbose)) { logmsg NOTICE, __x('Creating guest') }
$target->create_guest($g, $root, $meta, $config, $guestcaps, $output_name);
};
--
1.8.1.4
11 years
Status of virt-v2v?
by Mike Latimer
Hi,
I have recently been looking into virt-v2v, and noticed the mention of an upcoming rewrite in a few places. Is there a roadmap or post someplace that describes the future of this project?
I've got a couple of patches against the current code base, and am wondering if they will still be considered for inclusion.
Thanks,
Mike
11 years
[PATCH V2] sysprep: remove firewall rules
by Wanlong Gao
If we do not want to keep the original firewall rules, enable
this operation to remove these rules automatically.
Signed-off-by: Wanlong Gao <gaowanlong(a)cn.fujitsu.com>
---
sysprep/Makefile.am | 1 +
sysprep/sysprep_operation_firewall_rules.ml | 54 +++++++++++++++++++++++++++++
2 files changed, 55 insertions(+)
create mode 100644 sysprep/sysprep_operation_firewall_rules.ml
diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am
index ec6c2bc..fcd17fc 100644
--- a/sysprep/Makefile.am
+++ b/sysprep/Makefile.am
@@ -40,6 +40,7 @@ operations = \
dhcp_server_state \
dovecot_data \
flag_reconfiguration \
+ firewall_rules \
firstboot \
fs_uuids \
hostname \
diff --git a/sysprep/sysprep_operation_firewall_rules.ml b/sysprep/sysprep_operation_firewall_rules.ml
new file mode 100644
index 0000000..598b2e1
--- /dev/null
+++ b/sysprep/sysprep_operation_firewall_rules.ml
@@ -0,0 +1,54 @@
+(* virt-sysprep
+ * Copyright (C) 2013 Fujitsu Limited.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * 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.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *)
+
+open Sysprep_operation
+open Common_gettext.Gettext
+
+module G = Guestfs
+
+let firewall_rules_perform g root =
+ let typ = g#inspect_get_type root in
+ if typ <> "windows" then (
+ let paths = [ "/etc/sysconfig/iptables";
+ "/etc/firewalld/services/*";
+ "/etc/firewalld/zones/*"; ] in
+ List.iter (
+ fun path ->
+ let files = g#glob_expand path in
+ Array.iter (
+ fun file ->
+ try g#rm file with G.Error _ -> ()
+ ) files;
+ ) paths;
+
+ []
+ )
+ else []
+
+let op = {
+ defaults with
+ name = "firewall-rules";
+ enabled_by_default = false;
+ heading = s_"Remove the firewall rules";
+ pod_description = Some (s_"\
+If you do not want to keep the custom firewall rules, enable this operation
+to remove it automatically.");
+ perform_on_filesystems = Some firewall_rules_perform;
+}
+
+let () = register_operation op
--
1.8.4.27.g0a41de8
11 years