Bug 1345813
| Summary: | virt-sysprep --install always failed to install the packages specified | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Xianghua Chen <xchen> | ||||
| Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> | ||||
| Severity: | high | Docs Contact: | |||||
| Priority: | high | ||||||
| Version: | 7.3 | CC: | itmodelfont82, ptoscano, wshi, xchen | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | libguestfs-1.32.5-4.el7 | Doc Type: | If docs needed, set a value | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2016-11-03 18:01:43 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Xianghua Chen
2016-06-13 08:58:41 UTC
virt-sysprep isn't calling guestfs_set_network (g, true), so there is no network access. Should be a simple fix, looking at it now. Hello out there I'm kind of new to these as to I am seeking to get better results to this. So here goes nothing. Moe Tested with the packages:
libguestfs-1.32.5-6.el7.x86_64
Steps:
1. Prepare an rhel7 image: RHEL-Server-7.2-64-hvm.raw
2. Use virt-sysprep --install to install package:
-----------------------------------------------------------
# virt-sysprep -a RHEL-Server-7.2-64-hvm.raw --install pki-base
[ 0.0] Examining the guest ...
[ 3.2] Performing "abrt-data" ...
[ 3.2] Performing "bash-history" ...
[ 3.2] Performing "blkid-tab" ...
[ 3.2] Performing "crash-data" ...
[ 3.2] Performing "cron-spool" ...
[ 3.2] Performing "dhcp-client-state" ...
[ 3.2] Performing "dhcp-server-state" ...
[ 3.2] Performing "dovecot-data" ...
[ 3.2] Performing "logfiles" ...
[ 3.2] Performing "machine-id" ...
[ 3.2] Performing "mail-spool" ...
[ 3.2] Performing "net-hostname" ...
[ 3.2] Performing "net-hwaddr" ...
[ 3.2] Performing "pacct-log" ...
[ 3.2] Performing "package-manager-cache" ...
[ 3.2] Performing "pam-data" ...
[ 3.2] Performing "puppet-data-log" ...
[ 3.2] Performing "rh-subscription-manager" ...
[ 3.2] Performing "rhn-systemid" ...
[ 3.2] Performing "rpm-db" ...
[ 3.2] Performing "samba-db-log" ...
[ 3.2] Performing "script" ...
[ 3.2] Performing "smolt-uuid" ...
[ 3.2] Performing "ssh-hostkeys" ...
[ 3.2] Performing "ssh-userdir" ...
[ 3.2] Performing "sssd-db-log" ...
[ 3.2] Performing "tmp-files" ...
[ 3.2] Performing "udev-persistent-net" ...
[ 3.2] Performing "utmp" ...
[ 3.2] Performing "yum-uuid" ...
[ 3.2] Performing "customize" ...
[ 3.2] Setting a random seed
[ 3.2] Installing packages: pki-base
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-
: manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
http://download.englab.nay.redhat.com/pub/rhel/rel-eng/latest-RHEL-7/compose/Server/x86_64/os/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: download.englab.nay.redhat.com; Unknown error"
Trying other mirror.
One of the configured repositories failed (rhel7.2),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Disable the repository, so yum won't use it by default. Yum will then
just ignore the repository until you permanently enable it again or use
--enablerepo for temporary usage:
yum-config-manager --disable rhel7
4. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=rhel7.skip_if_unavailable=true
failure: repodata/repomd.xml from rhel7: [Errno 256] No more mirrors to try.
http://download.englab.nay.redhat.com/pub/rhel/rel-eng/latest-RHEL-7/compose/Server/x86_64/os/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: download.englab.nay.redhat.com; Unknown error"
virt-sysprep: warning: the command may have failed because the network is
disabled. Try either removing '--no-network' or adding '--network' on the
command line.
virt-sysprep: error: yum -y install 'pki-base': command exited with an
error
If reporting bugs, run virt-sysprep with debugging enabled and include the
complete output:
virt-sysprep -v -x [...]
---------------------------------------------------
The error is still there.
You need to add the --network option, as described in the manual:
--network
--no-network
Enable or disable network access from the guest during the
installation.
In virt-sysprep, the network is disabled by default. You must use
--network to enable it, in order that options such as --install or
--update will work.
virt-builder(1) has more information about the security advantages
of disabling the network.
Verified with the packages: libguestfs-1.32.5-6.el7.x86_64 Verify steps: 1. Prepare an rhel7 image: RHEL-Server-7.2-64-hvm.raw 2. Use virt-sysprep --install to install package: # virt-sysprep -a RHEL-Server-7.2-64-hvm.raw --install pki-base --network # guestfish -a RHEL-Server-7.2-64-hvm.raw -i sh 'rpm -qa |grep -i pki-base' pki-base-10.2.5-6.el7.noarch The commands finished successfully and there is pki-base package installed. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2016-2576.html |