kxr / ocp4_setup_upi_kvm

Script to Setup an OpenShift 4 UPI Cluster on KVM. Based on this guide: https://kxr.me/2019/08/17/openshift-4-upi-install-libvirt-kvm/
50 stars 55 forks source link

Unable to install virt-customize: error: yum -y install 'haproxy': command exited with an error #14

Closed ksingh7 closed 3 years ago

ksingh7 commented 4 years ago

Hi

Tried multiple times on 4.2.latest and 4.5.latest but never managed to get this working

Can you suggest whats could be the problem

#################################
### CREATING LOAD BALANCER VM ###
#################################
====> Downloading Centos 7 cloud image: (reusing cached file)
====> Copying Image for Loadbalancer VM: ok
====> Setting up Loadbalancer VM:
[   0.0] Examining the guest ...
[  27.6] Setting a random seed
[  27.8] Uninstalling packages: cloud-init
[  53.1] SSH key inject: root
[  72.3] Installing packages: haproxy
Loaded plugins: fastestmirror
Resolving Dependencies
--> Running transaction check
---> Package cloud-init.x86_64 0:18.5-6.el7.centos will be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package          Arch         Version                    Repository       Size
================================================================================
Removing:
 cloud-init       x86_64       18.5-6.el7.centos          installed       3.0 M

Transaction Summary
================================================================================
Remove  1 Package

Installed size: 3.0 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Erasing    : cloud-init-18.5-6.el7.centos.x86_64                          1/1
warning: file /run/cloud-init: remove failed: No such file or directory
  Verifying  : cloud-init-18.5-6.el7.centos.x86_64                          1/1

Removed:
  cloud-init.x86_64 0:18.5-6.el7.centos

Complete!
Loaded plugins: fastestmirror
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=genclo error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"

 One of the configured repositories failed (Unknown),
 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. Run the command with the repository temporarily disabled
            yum --disablerepo=<repoid> ...

     4. Disable the repository permanently, 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 <repoid>
        or
            subscription-manager repos --disable=<repoid>

     5. 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=<repoid>.skip_if_unavailable=true
Cannot find a valid baseurl for repo: base/7/x86_64
virt-customize: error: yum -y install 'haproxy': command exited with an
error

If reporting bugs, run virt-customize with debugging enabled and include
the complete output:

  virt-customize -v -x [...]
ksingh7 commented 4 years ago

@kxr any suggestions

kxr commented 4 years ago

@ksingh7 It seems the problem is the lack of internet access on the VMs spawned in libvirt/kvm. This should be easy to fix. Try the following: