[PATCH v2 0/2] error accessing harddrive partitions
by Pavel Butsykin
virt-v2v fails when traverses each partition:
inspect_sources.ml:
...
and is_uefi_bootable_part part =
let dev = g#part_to_dev part in
parttype_is_gpt dev && is_uefi_ESP dev part
in
let partitions = Array.to_list (g#list_partitions ()) in
let partitions = List.filter is_uefi_bootable_part partitions in
log:
...
libguestfs: trace: v2v: list_partitions
guestfsd: main_loop: new request, len 0x28
guestfsd: main_loop: proc 8 (list_partitions) took 0.00 seconds
libguestfs: trace: v2v: list_partitions = ["/dev/sda1", "/dev/sda2", "/dev/sda3",
"/dev/sdb1", "/dev/sdb2", "/dev/sdb5", "/dev/sdc1", "/dev/sdc2", "/dev/sdc5",
"/dev/sdd1", "/dev/sdd2", "/dev/sdd5", "/dev/sde1", "/dev/sde2", "/dev/sde5",
"/dev/sdf1", "/dev/sdf2", "/dev/sdf5", "/dev/sdg1", "/dev/sdg2", "/dev/sdg5"]
...
libguestfs: trace: v2v: part_get_parttype "/dev/sdb"
guestfsd: main_loop: new request, len 0x34
commandrvf: stdout=y stderr=y flags=0x0
commandrvf: parted -m -s -- /dev/sdb unit b print
libguestfs: trace: v2v: part_get_parttype = "msdos"
libguestfs: trace: v2v: part_get_parttype "/dev/sdb"
guestfsd: main_loop: proc 214 (part_get_parttype) took 0.00 seconds
guestfsd: main_loop: new request, len 0x34
commandrvf: stdout=y stderr=y flags=0x0
commandrvf: parted -m -s -- /dev/sdb unit b print
libguestfs: trace: v2v: part_get_parttype = "msdos"
libguestfs: trace: v2v: part_to_dev "/dev/sdb5"
guestfsd: main_loop: proc 214 (part_get_parttype) took 0.00 seconds
[ 9.164666] sdb: sdb1 sdb2 < sdb5 >
guestfsd: main_loop: new request, len 0x38
/dev/sdb5: No such file or directory
call part_to_dev "/dev/sdb5" failed in is_root_device():
part_to_dev_stub()
RESOLVE_DEVICE()
is_root_device ():
{
struct stat statbuf;
if (stat (device, &statbuf) == -1) {
perror (device);
return 0;
...
let's look at the udev event log after the error:
KERNEL[10.527855] change /devices/pci0000:00/0000:00:03.0/virtio1/host2/target2:0:1/2:0:1:0/block/sdb (block)
UDEV [10.528693] change /devices/pci0000:00/0000:00:03.0/virtio1/host2/target2:0:0/2:0:0:0/block/sda/sda1 (block)
KERNEL[10.529156] add /devices/pci0000:00/0000:00:03.0/virtio1/host2/target2:0:1/2:0:1:0/block/sdb/sdb1 (block)
KERNEL[10.529618] add /devices/pci0000:00/0000:00:03.0/virtio1/host2/target2:0:1/2:0:1:0/block/sdb/sdb2 (block)
KERNEL[10.530096] add /devices/pci0000:00/0000:00:03.0/virtio1/host2/target2:0:1/2:0:1:0/block/sdb/sdb5 (block)
...
Apparently is_root_device("/dev/sdb5") was called before "/dev/sdb5" was added.
To solve issue we need to wait adding a partition before we can access it.
Another solution if we wait for adding all partitions somewhere in one place.
But there is at least one drawback, not for each task need to touch the disk
partitions and waiting for all partitions will slow such tasks.
Pavel Butsykin (2):
daemon: run 'udevadm settle' with --exit-if-exists option
daemon: add udev_settle_file to is_root_device
daemon/daemon.h | 2 ++
daemon/guestfsd.c | 42 +++++++++++++++++++++++++++++++-----------
2 files changed, 33 insertions(+), 11 deletions(-)
--
2.11.0
7 years, 8 months
[PATCH virt-v2v] v2v: windows: Install both legacy and modern virtio
by Richard W.M. Jones
Hello Roman,
We have a bug with Windows 8 UEFI conversions failing with the usual
0x7B error:
https://bugzilla.redhat.com/show_bug.cgi?id=1431579
There is a seemingly plausible theory that this happens because for
UEFI we use a qemu Q35 machine type.
Q35 machine type implies all-modern PCI-e devices, which implies the
use of virtio-1.0 and disabling of virtio legacy.
Virtio-1.0 uses different Windows registry keys: viostor changes from
VEN_1AF4&DEV_1001&SUBSYS_00021AF4&REV_00 ->
VEN_1AF4&DEV_1042&SUBSYS_11001AF4&REV_01, and vioscsi has a similar
change.
As we are only installing the virtio legacy key, but presenting
PCI-e virtio-1.0 (modern) devices to the guest, this may cause Windows
to fail to boot.
I have not gone beyond compile-testing the attached patch, but what do
you think? I will try to actually test this tomorrow, but I wondered
if you have any comments.
Thanks,
Rich.
7 years, 8 months
[PATCH] mllib: Bind %identity C primitive to Common_utils.identity.
by Richard W.M. Jones
---
mllib/common_utils.ml | 2 ++
mllib/common_utils.mli | 2 ++
mllib/xpath_helpers.ml | 2 --
v2v/input_vmx.ml | 2 --
v2v/v2v_unit_tests.ml | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml
index 63d8dd92e..6a9b08973 100644
--- a/mllib/common_utils.ml
+++ b/mllib/common_utils.ml
@@ -282,6 +282,8 @@ let ( /^ ) = Int64.div
let ( &^ ) = Int64.logand
let ( ~^ ) = Int64.lognot
+external identity : 'a -> 'a = "%identity"
+
let roundup64 i a = let a = a -^ 1L in (i +^ a) &^ (~^ a)
let div_roundup64 i a = (i +^ a -^ 1L) /^ a
diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli
index ec41a8ff8..0669a42bf 100644
--- a/mllib/common_utils.mli
+++ b/mllib/common_utils.mli
@@ -142,6 +142,8 @@ val ( &^ ) : int64 -> int64 -> int64
val ( ~^ ) : int64 -> int64
(** Various int64 operators. *)
+external identity : 'a -> 'a = "%identity"
+
val roundup64 : int64 -> int64 -> int64
(** [roundup64 i a] returns [i] rounded up to the next multiple of [a]. *)
val div_roundup64 : int64 -> int64 -> int64
diff --git a/mllib/xpath_helpers.ml b/mllib/xpath_helpers.ml
index 8648596a4..d651fab23 100644
--- a/mllib/xpath_helpers.ml
+++ b/mllib/xpath_helpers.ml
@@ -36,8 +36,6 @@ let xpath_eval parsefn xpathctx expr =
expr str
)
-external identity : 'a -> 'a = "%identity"
-
let xpath_string = xpath_eval identity
let xpath_int = xpath_eval int_of_string
let xpath_int64 = xpath_eval Int64.of_string
diff --git a/v2v/input_vmx.ml b/v2v/input_vmx.ml
index b72161a82..c48a0155a 100644
--- a/v2v/input_vmx.ml
+++ b/v2v/input_vmx.ml
@@ -26,8 +26,6 @@ open Types
open Utils
open Name_from_disk
-external identity : 'a -> 'a = "%identity"
-
let rec find_disks vmx vmx_filename =
find_scsi_disks vmx vmx_filename @ find_ide_disks vmx vmx_filename
diff --git a/v2v/v2v_unit_tests.ml b/v2v/v2v_unit_tests.ml
index 51284a9aa..7f98e09d3 100644
--- a/v2v/v2v_unit_tests.ml
+++ b/v2v/v2v_unit_tests.ml
@@ -23,7 +23,7 @@ open Types
open Printf
-external identity : 'a -> 'a = "%identity"
+open Common_utils
let inspect_defaults = {
i_type = ""; i_distro = ""; i_arch = "";
--
2.12.0
7 years, 8 months
[PATCH 0/2] error accessing harddrive partitions
by Pavel Butsykin
virt-v2v fails when traverses each partition:
inspect_sources.ml:
...
and is_uefi_bootable_part part =
let dev = g#part_to_dev part in
parttype_is_gpt dev && is_uefi_ESP dev part
in
let partitions = Array.to_list (g#list_partitions ()) in
let partitions = List.filter is_uefi_bootable_part partitions in
log:
...
libguestfs: trace: v2v: list_partitions
guestfsd: main_loop: new request, len 0x28
guestfsd: main_loop: proc 8 (list_partitions) took 0.00 seconds
libguestfs: trace: v2v: list_partitions = ["/dev/sda1", "/dev/sda2", "/dev/sda3",
"/dev/sdb1", "/dev/sdb2", "/dev/sdb5", "/dev/sdc1", "/dev/sdc2", "/dev/sdc5",
"/dev/sdd1", "/dev/sdd2", "/dev/sdd5", "/dev/sde1", "/dev/sde2", "/dev/sde5",
"/dev/sdf1", "/dev/sdf2", "/dev/sdf5", "/dev/sdg1", "/dev/sdg2", "/dev/sdg5"]
...
libguestfs: trace: v2v: part_get_parttype "/dev/sdb"
guestfsd: main_loop: new request, len 0x34
commandrvf: stdout=y stderr=y flags=0x0
commandrvf: parted -m -s -- /dev/sdb unit b print
libguestfs: trace: v2v: part_get_parttype = "msdos"
libguestfs: trace: v2v: part_get_parttype "/dev/sdb"
guestfsd: main_loop: proc 214 (part_get_parttype) took 0.00 seconds
guestfsd: main_loop: new request, len 0x34
commandrvf: stdout=y stderr=y flags=0x0
commandrvf: parted -m -s -- /dev/sdb unit b print
libguestfs: trace: v2v: part_get_parttype = "msdos"
libguestfs: trace: v2v: part_to_dev "/dev/sdb5"
guestfsd: main_loop: proc 214 (part_get_parttype) took 0.00 seconds
[ 9.164666] sdb: sdb1 sdb2 < sdb5 >
guestfsd: main_loop: new request, len 0x38
/dev/sdb5: No such file or directory
call part_to_dev "/dev/sdb5" failed in is_root_device():
part_to_dev_stub()
RESOLVE_DEVICE()
is_root_device ():
{
struct stat statbuf;
if (stat (device, &statbuf) == -1) {
perror (device);
return 0;
...
let's look at the udev event log after the error:
KERNEL[10.527855] change /devices/pci0000:00/0000:00:03.0/virtio1/host2/target2:0:1/2:0:1:0/block/sdb (block)
UDEV [10.528693] change /devices/pci0000:00/0000:00:03.0/virtio1/host2/target2:0:0/2:0:0:0/block/sda/sda1 (block)
KERNEL[10.529156] add /devices/pci0000:00/0000:00:03.0/virtio1/host2/target2:0:1/2:0:1:0/block/sdb/sdb1 (block)
KERNEL[10.529618] add /devices/pci0000:00/0000:00:03.0/virtio1/host2/target2:0:1/2:0:1:0/block/sdb/sdb2 (block)
KERNEL[10.530096] add /devices/pci0000:00/0000:00:03.0/virtio1/host2/target2:0:1/2:0:1:0/block/sdb/sdb5 (block)
...
Apparently is_root_device("/dev/sdb5") was called before "/dev/sdb5" was added.
To solve issue we need to wait adding a partition before we can access it.
Another solution if we wait for adding all partitions somewhere in one place.
But there is at least one drawback, not for each task need to touch the disk
partitions and waiting for all partitions will slow such tasks.
Pavel Butsykin (2):
daemon: run 'udevadm settle' with --exit-if-exists option.
daemon: add udev_settle_file to is_root_device
daemon/daemon.h | 2 ++
daemon/guestfsd.c | 23 +++++++++++++++++++----
2 files changed, 21 insertions(+), 4 deletions(-)
--
2.11.0
7 years, 8 months
[PATCH] appliance: add cdrkit-cdrtools-compat on openSUSE
by Pino Toscano
It looks like isoinfo is in that package since openSUSE Leap 42.1, so
make sure to include it to not break the isoinfo* APIs.
---
appliance/packagelist.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/appliance/packagelist.in b/appliance/packagelist.in
index 5cf2276..0a71cc3 100644
--- a/appliance/packagelist.in
+++ b/appliance/packagelist.in
@@ -136,6 +136,7 @@ ifelse(SUSE,1,
dnl It seems no other augeas package depends on it.
augeas-lenses
btrfsprogs
+ cdrkit-cdrtools-compat
cryptsetup
dhcpcd
dhcp-client
--
2.9.3
7 years, 8 months
[PATCH] builder: various improvements to the documentation
by Pino Toscano
- convert the Fedora 20 examples to Fedora 25
- convert the yum examples to dnf
- convert the Debian 7 examples to Debian 8
- mention that --core updates all the installed packages, not "core"
ones
- convert i386 to i686 for the Fedora 32bit examples
- mention that autogenerated root passwords are printed on stdout
- mention --get-kernel is deprecated in favour of virt-get-kernel
- update URL to the Puppet installation documentation
- edit the repository index documentation to make it clearer
non-compressed templates are supported
- remove old wrong paragraph about customization specified in command
line not processed in the same order
- use --install instead of --run-command '$pkgmgr install ...'
- other minor changes
---
builder/virt-builder.pod | 144 ++++++++++++++++++++++++-----------------------
1 file changed, 73 insertions(+), 71 deletions(-)
diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
index dbbd646..74bf7bb 100644
--- a/builder/virt-builder.pod
+++ b/builder/virt-builder.pod
@@ -59,14 +59,14 @@ your own too (see below).
After choosing a guest from the list, you may want to see if there
are any installation notes:
- virt-builder --notes fedora-20
+ virt-builder --notes fedora-25
=head2 Build a virtual machine
- virt-builder fedora-20
+ virt-builder fedora-25
-will build a Fedora 20 image for the same architecture as virt-builder
-(so running it from an i386 installation will try to build an i386
+will build a Fedora 25 image for the same architecture as virt-builder
+(so running it from an i686 installation will try to build an i686
image, if available). This will have all default
configuration (minimal size, no user accounts, random root password,
only the bare minimum installed software, etc.).
@@ -77,57 +77,57 @@ The first time this runs it has to download the template over the
network, but this gets cached (see L</CACHING>).
The name of the output file is derived from the template name, so
-above it will be F<fedora-20.img>. You can change the output filename
+above it will be F<fedora-25.img>. You can change the output filename
using the I<-o> option:
- virt-builder fedora-20 -o mydisk.img
+ virt-builder fedora-25 -o mydisk.img
You can also use the I<-o> option to write to existing devices or
logical volumes.
- virt-builder fedora-20 --format qcow2
+ virt-builder fedora-25 --format qcow2
-As above, but write the output in qcow2 format to F<fedora-20.qcow2>.
+As above, but write the output in qcow2 format to F<fedora-25.qcow2>.
- virt-builder fedora-20 --size 20G
+ virt-builder fedora-25 --size 20G
As above, but the output size will be 20 GB. The guest OS is resized
as it is copied to the output (automatically, using
L<virt-resize(1)>).
- virt-builder fedora-20 --arch i386
+ virt-builder fedora-25 --arch i686
-As above, but using an i386 template, if available.
+As above, but using an i686 template, if available.
=head2 Setting the root password
- virt-builder fedora-20 --root-password file:/tmp/rootpw
+ virt-builder fedora-25 --root-password file:/tmp/rootpw
-Create a Fedora 20 image. The root password is taken from the file
+Create a Fedora 25 image. The root password is taken from the file
F</tmp/rootpw>.
Note if you I<don’t> set I<--root-password> then the guest is given
-a I<random> root password.
+a I<random> root password which is printed on stdout.
You can also create user accounts. See L</USERS AND PASSWORDS> below.
=head2 Set the hostname
- virt-builder fedora-20 --hostname virt.example.com
+ virt-builder fedora-25 --hostname virt.example.com
Set the hostname to C<virt.example.com>.
=head2 Installing software
To install packages from the ordinary (guest) software repository
-(eg. yum or apt):
+(eg. dnf or apt):
- virt-builder fedora-20 --install "inkscape,@Xfce Desktop"
+ virt-builder fedora-25 --install "inkscape,@Xfce Desktop"
(In Fedora, C<@> is used to install groups of packages. On Debian
you would install a meta-package instead.)
-To update the core packages to the latest version:
+To update the installed packages to the latest version:
virt-builder debian-7 --update
@@ -135,7 +135,7 @@ For guests which use SELinux, like Fedora and Red Hat Enterprise
Linux, you may need to do SELinux relabelling after installing or
updating packages (see L</SELINUX> below):
- virt-builder fedora-20 --update --selinux-relabel
+ virt-builder fedora-25 --update --selinux-relabel
=head2 Customizing the installation
@@ -149,27 +149,27 @@ I<--edit> to edit files. I<--upload> to upload files.
For example:
- cat <<'EOF' > /tmp/yum-update.sh
- yum -y update
+ cat <<'EOF' > /tmp/dnf-update.sh
+ dnf -y --best update
EOF
- virt-builder fedora-20 --firstboot /tmp/yum-update.sh
+ virt-builder fedora-25 --firstboot /tmp/dnf-update.sh
or simply:
- virt-builder fedora-20 --firstboot-command 'yum -y update'
+ virt-builder fedora-25 --firstboot-command 'dnf -y --best update'
-which makes the L<yum(8)> C<update> command run once the first time
+which makes the L<dnf(8)> C<update> command run once the first time
the guest boots.
Or:
- virt-builder fedora-20 \
- --edit '/etc/yum.conf:
+ virt-builder fedora-25 \
+ --edit '/etc/dnf/dnf.conf:
s/gpgcheck=1/gpgcheck=0/'
-which edits F</etc/yum.conf> inside the disk image (during disk image
-creation, long before boot).
+which edits F</etc/dnf/dnf.conf> inside the disk image (during disk
+image creation, long before boot).
You can combine these options, and have multiple options of all types.
@@ -301,6 +301,9 @@ This option extracts the kernel and initramfs from a previously built
disk image called C<IMAGE> (in fact it works for any VM disk image,
not just ones built using virt-builder).
+Note this method is B<deprecated>: there is a separate tool for this,
+L<virt-get-kernel(1)>, which has more options for the file extraction.
+
The kernel and initramfs are written to the current directory, unless
you also specify the I<--output> C<outputdir> B<directory> name.
@@ -554,16 +557,16 @@ If the guest OS you are installing is similar to the host OS (eg.
both are Linux), and if libguestfs supports network connections, then
you can use I<--install> to install packages like this:
- virt-builder fedora-20 --install inkscape
+ virt-builder fedora-25 --install inkscape
This uses the guest’s package manager and the host’s network
connection.
=head3 Updating packages at build time
-To update the core set of packages in the template at build time:
+To update the installed packages in the template at build time:
- virt-builder fedora-20 --update
+ virt-builder fedora-25 --update
Most of the templates that ship with virt-builder come with a very
minimal selection of packages (known as a "JEOS" or "Just Enough
@@ -575,7 +578,7 @@ OS from the template. This option updates those template packages.
Another option is to install the packages when the guest first boots:
- virt-builder fedora-20 --firstboot-install inkscape
+ virt-builder fedora-25 --firstboot-install inkscape
This uses the guest’s package manager and the guest’s network
connection.
@@ -598,7 +601,7 @@ L<virt-make-fs(1)>. For genisoimage, use a command like this:
genisoimage -o extra-packages.iso -R -J -V EXTRA cdcontents/
Create a script that mounts the ISO and sets up the repository. For
-yum, create /tmp/install.sh containing:
+dnf, create /tmp/install.sh containing:
mkdir /tmp/mount
mount LABEL=EXTRA /tmp/mount
@@ -610,7 +613,7 @@ yum, create /tmp/install.sh containing:
enabled=1
EOF
- yum -y install famousdatabase
+ dnf -y install famousdatabase
For apt, create /tmp/install.sh containing:
@@ -623,7 +626,7 @@ For apt, create /tmp/install.sh containing:
Use the I<--attach> option to attach the CD / disk image and the
I<--run> option to run the script:
- virt-builder fedora-20 \
+ virt-builder fedora-25 \
--attach extra-packages.iso \
--run /tmp/install.sh
@@ -702,7 +705,7 @@ keyboard for some common Linux distributions.
For distros that use systemd C<localectl>, use a command like this:
- virt-builder fedora-20 \
+ virt-builder fedora-25 \
--firstboot-command 'localectl set-keymap uk'
See L<localectl(1)> and
@@ -726,7 +729,7 @@ For Debian-derived distros using F</etc/default/keyboard>, upload or
modify the keyboard file using the I<--upload>, I<--write> or
I<--edit> options. For example:
- virt-builder debian-7 \
+ virt-builder debian-8 \
--edit '/etc/default/keyboard: s/^XKBLAYOUT=.*/XKBLAYOUT="gb"/'
See L<https://wiki.debian.org/Keyboard>.
@@ -744,9 +747,9 @@ of virt-builder to do this.
This section contains examples for some common Linux distributions.
-=head3 Setting Japanese in Fedora 20
+=head3 Setting Japanese in Fedora 25
- virt-builder fedora-20 \
+ virt-builder fedora-25 \
--size 20G \
--update \
--install @japanese-support \
@@ -757,7 +760,7 @@ This section contains examples for some common Linux distributions.
--firstboot-command 'localectl set-keymap jp' \
--firstboot-command 'systemctl isolate graphical.target'
-=head3 Setting Japanese in Debian 7 (Wheezy)
+=head3 Setting Japanese in Debian 8 (Jessie)
Note that although this enables Japanese in the text console too, it
is unlikely that you will see properly rendered Japanese there.
@@ -765,15 +768,14 @@ However Japanese is properly rendered in X applications and terminals.
pkgs=locales,xfce4,\
ibus,ibus-anthy,\
- ttf-sazanami-gothic,ttf-sazanami-mincho,\
+ fonts-ipafont-gothic,fonts-ipafont-mincho,\
fonts-takao-mincho,\
xfonts-intl-japanese,xfonts-intl-japanese-big,\
iceweasel-l10n-ja,manpages-ja
- virt-builder debian-7 \
+ virt-builder debian-8 \
--size 20G \
--install $pkgs \
- --edit '/etc/inittab: s,^#([1-9].*respawn.*/sbin/getty.*),$1,' \
--edit '/etc/locale.gen: s,^#\s*ja,ja,' \
--write '/etc/default/locale:LANG="ja_JP.UTF-8"' \
--run-command "locale-gen"
@@ -788,7 +790,7 @@ logged in one of the following locations:
=item F</tmp/builder.log>
-On Linux, BSD and other guests.
+On Linux, BSD, and other non-Windows guests.
=item F<C:\Temp\builder.log>
@@ -975,7 +977,7 @@ I<--import> option.
virt-install --import \
--name guest --ram 2048 \
- --disk path=disk.img,format=raw --os-variant fedora20
+ --disk path=disk.img,format=raw --os-variant fedora25
Notes:
@@ -1010,7 +1012,7 @@ tools probably work differently as well.
Import the image into Glance (the OpenStack image store) by doing:
- glance image-create --name fedora-20-image --file fedora-20.img \
+ glance image-create --name fedora-25-image --file fedora-25.img \
--disk-format raw --container-format bare \
--is-public True
@@ -1020,12 +1022,12 @@ parameter should match virt-builder’s I<--format> option (or C<raw> if
you didn't use that option). The I<--container-format> should always
be C<bare> since virt-builder doesn't put images into containers.
-You can use the S<C<glance image-show I<fedora-20-image>>> command to
+You can use the S<C<glance image-show I<fedora-25-image>>> command to
display the properties of the image.
To boot up an instance of your image on a Nova compute node, do:
- nova boot fedora-20-server --image fedora-20-image \
+ nova boot fedora-25-server --image fedora-25-image \
--flavor m1.medium
Use S<C<nova flavor-list>> to list possible machine flavors. Use
@@ -1056,18 +1058,18 @@ at boot.
A typical virt-builder command would be:
- virt-builder fedora-20 \
+ virt-builder fedora-25 \
--hostname client.example.com \
--update \
--install puppet \
- --edit '/etc/puppet/puppet.conf:
- s/^\[agent\]/[agent]\n server = puppetmaster.example.com/' \
+ --append-line '/etc/puppet/puppet.conf:[agent]' \
+ --append-line '/etc/puppet/puppet.conf:server = puppetmaster.example.com/' \
--run-command 'systemctl enable puppet' \
--selinux-relabel
The precise instructions vary according to the Linux distro. For
further information see:
-L<http://docs.puppetlabs.com/guides/installation.htm>
+L<https://docs.puppet.com/puppet/latest/install_pre.html>
=head2 DEBUGGING BUILDS
@@ -1277,6 +1279,10 @@ clone existing guests (see L<virt-sysprep(1)>), or you could install a
guest by hand (L<virt-install(1)>). To see how the templates were
created for virt-builder, look at the scripts in C<builder/templates>
+Virt-builder supports any image format (e.g. raw, qcow2, etc) as
+template, both as-is, and compressed as XZ. This way, existing images
+(e.g. cleaned using L<virt-sysprep(1)>) can be used as templates.
+
For best results when compressing the templates, use the following xz
options (see L<nbdkit-xz-plugin(1)> for further explanation):
@@ -1366,8 +1372,8 @@ The file can be created as follows:
=item C<checksum[sha512]=7b882fe9b82eb0fef...>
-The SHA-512 checksum of the B<compressed> file is checked after it is
-downloaded. To work out the signature, do:
+The SHA-512 checksum of the file specified in I<file=..> is checked
+after it is downloaded. To work out the signature, do:
sha512sum disk.xz
@@ -1395,9 +1401,10 @@ The revision number is optional. If omitted it defaults to C<1>.
=item C<format=qcow2>
-Specify the format of the disk image (before it was compressed). If
-not given, the format is autodetected, but generally it is better to
-be explicit about the intended format.
+Specify the format of the disk image; in case it is compressed, that
+is the format before the compression. If not given, the format is
+autodetected, but generally it is better to be explicit about the
+intended format.
Note this is the source format, which is different from the
I<--format> option (requested output format). Virt-builder does
@@ -1418,8 +1425,9 @@ I<--size> option.
=item C<compressed_size=NNN>
-The compressed size of the disk image in bytes. This is just used for
-information (when using I<--list --long>).
+The actual size of the disk image in bytes, i.e. what was specified
+in I<file=..>. This is just used for information (when using C<long>,
+and C<json> formats of I<--list>).
=item C<expand=/dev/sdaX>
@@ -1568,18 +1576,11 @@ To increase both speed and reliability of installing packages, you can
set up a local mirror of the target distribution, and point the guest
package manager at that.
-Because of the order in which each phase of installation happens, you
-cannot use I<--write> (to point the package manager at a repo)
-followed by I<--install> (to install from that repo). The I<--write>
-and I<--install> steps run in the opposite order, regardless of their
-order on the command line. You have to do this using I<--run-command>
-instead of I<--install>.
-
=head4 Using a local mirror with Fedora
To install a Fedora guest using a local mirror:
- virt-builder fedora-20 \
+ virt-builder fedora-25 \
--edit '/etc/yum.repos.d/fedora.repo:
s{.*baseurl=.*}{baseurl=http://example.com/mirror/};
s{.*metalink=.*}{};
@@ -1588,8 +1589,8 @@ To install a Fedora guest using a local mirror:
s{.*baseurl=.*}{baseurl=http://example.com/mirror-updates/};
s{.*metalink=.*}{};
' \
- --run-command 'yum -y update' \
- --run-command 'yum -y install pkg1 pkg2 ...'
+ --run-command 'dnf -y update' \
+ --install 'pkg1,pkg2,...'
=head4 Using a local mirror with Debian
@@ -1597,10 +1598,10 @@ Assuming that you are using C<apt-proxy> to mirror the repository, you
should create a new F<sources.list> file to point to your proxy (see
L<https://help.ubuntu.com/community/AptProxy>) and then do:
- virt-builder debian-7 \
+ virt-builder debian-8 \
--upload sources.list:/etc/apt/sources.list \
--run-command 'apt-get -y update' \
- --run-command 'apt-get -y install pkg1 pkg2 ...'
+ --install 'pkg1,pkg2,...'
=head2 DIGITAL SIGNATURES
@@ -1876,6 +1877,7 @@ L<guestfish(1)>,
L<guestmount(1)>,
L<virt-copy-out(1)>,
L<virt-customize(1)>,
+L<virt-get-kernel(1)>,
L<virt-install(1)>,
L<virt-rescue(1)>,
L<virt-resize(1)>,
--
2.9.3
7 years, 8 months
[PATCH v2] v2v: ovf: Add virtio-rng and memory balloon device
by Tomáš Golembiovský
This affects -o rhv and -o vdsm.
Signed-off-by: Tomáš Golembiovský <tgolembi(a)redhat.com>
---
v2v/create_ovf.ml | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/v2v/create_ovf.ml b/v2v/create_ovf.ml
index cfca63452..f5dc64753 100644
--- a/v2v/create_ovf.ml
+++ b/v2v/create_ovf.ml
@@ -390,6 +390,29 @@ let rec create_ovf source targets guestcaps inspect
]
];
+ (* Add the miscellaneous KVM devices. *)
+ if guestcaps.gcaps_virtio_rng then
+ append virtual_hardware_section_items [
+ e "Item" [] [
+ e "rasd:Caption" [] [PCData "RNG Device"];
+ e "rasd:InstanceId" [] [PCData (uuidgen ())];
+ e "rasd:ResourceType" [] [PCData "0"];
+ e "Type" [] [PCData "rng"];
+ e "Device" [] [PCData "virtio"];
+ ]
+ ];
+ if guestcaps.gcaps_virtio_balloon then
+ append virtual_hardware_section_items [
+ e "Item" [] [
+ e "rasd:Caption" [] [PCData "Memory Ballooning Device"];
+ e "rasd:InstanceId" [] [PCData (uuidgen ())];
+ e "rasd:ResourceType" [] [PCData "0"];
+ e "Type" [] [PCData "balloon"];
+ e "Device" [] [PCData "memballoon"];
+ ]
+ ];
+
+
push_back content_subnodes (
e "Section" ["xsi:type", "ovf:VirtualHardwareSection_Type"]
!virtual_hardware_section_items
--
2.12.1
7 years, 8 months
Virt-win-reg gives weird error
by Keresztes Péter-Zoltán
Hello,
I have just compiled the libguestfs version 1.34.2.
When I run virt-win-reg vm-1051-disk-1.qcow2 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce' "Test"="c:\\Users\Administrator\test.bat” I get the following error:
Can't exec "hivexget": No such file or directory at /usr/local/bin/virt-win-reg line 351.
hivexget failed: -1 at /usr/local/bin/virt-win-reg line 351.
Any idea how to fix it?
Regards,
Peter
7 years, 8 months