Tagged with vmware

Installation and configuration of Red Hat Satellite 6: tips, workarounds, fixes and links

This post is a work in progress. I will keep track of the issues that I ran into while installing and configuring Red Hat Satellite 6 on Enterprise Linux 7.

Satellite as single instance

Are you running Satellite as a single instance to do "everything"? Then enable its DHCP, DNS and TFTP capsules (smart proxies)!

Repo issue on content host

In case of repo issues on a content host, run yum clean all and yum update first, before debugging further.

New content view created

When you create a Content View, be patient and let your repositories sync first.

Red Hat Common repository

Remember to add the Red Hat Common repository to the Content View of your VMs.

Satellite 6.0 specific

Satellite + VMware + "Unlimited Guest Subscription"

How to register RHEV / VMWare guest systems to Red Hat Satellite v6 to use 'Red Hat Unlimited Guest Subscription' subscriptions? by Mario Gamboa

Missing repos on client

Created a Content View but the client isn't showing all the repositories that you added? On the client:

  1. list all available subscriptions and look for the missing one: subscription-manager list --available --all
  2. add the missing subscription using its Pool ID: subscription-manager attach --pool=1234567890
  3. verify the subscription has been added: subscription-manager list --available --consumed
  4. see issue #2

If the repositories for your Content View aren't added/enabled automatically with subscription-manager register --org="Your_Organization" --activationkey="Your_Activation_Key" and subscription-manager attach --auto, in the Satellite 6 web interface go to Content → Activation Keys. Select your activation key and list the subscriptions. Make sure the subscriptions for your non-Red Hat repositories are added to the activation key.

RHEL 5 machines installed with Satellite 6 can't "consume" custom repositories

yum fails with [Errno -3] Error performing checksum: this is caused by the SHA-256 checksums used by Pulp for the repository. yum shipped with RHEL 5 doesn't support SHA256 yet. You can get SHA256 support by installing python-hashlib. Unfortunately, this package is not included in the Kickstart repository so you can't simply include it in the @packages list of your Kickstart file.

  1. Disable all your custom repositories
  2. Enable the Red Hat repositories
  3. Install python-hashlib
  4. Enable the custom repositories again
<%
  rhel_compatible = @host.operatingsystem.family == 'Redhat' && @host.operatingsystem.name != 'Fedora'
  os_major = @host.operatingsystem.major.to_i
  section_end = (rhel_compatible && os_major <= 5) ? '' : '%end'
%>

# Workaround for RHEL5 yum's SHA-256 incompatibility
# see https://bugzilla.redhat.com/show_bug.cgi?id=1009578 and
# https://bugzilla.redhat.com/show_bug.cgi?id=1127402
echo "Workaround for SHA256 incompatibility in RHEL5 yum"
subscription-manager repos --disable="*Default_Organization_*"
subscription-manager repos --enable="rhel-<%= @host.operatingsystem.major %>-*"
yum -y install python-hashlib
subscription-manager repos --enable="*Default_Organization_*"

Trying to publish new version of a Content View results in error Duplicate resource: Default_Organization-Example

This is a known bug and is supposed to be solved in Satellite 6.1, the fix won't be backported to 6.0. To fix the issue in Satellite 6.0, follow the steps from Mike McCune's post.

Failed to generate PXELinux template: private methodtemplate' called for nil:NilClass` when trying to cancel a build

This cryptic error is caused by a missing PXE template.

  1. In the Satellite 6 web interface go to Administer → Locations → Your Location → Templates and make sure that every template starting with "PXE" is added to your Location.
  2. Repeat the steps of #1 for Administer → Organization → Your Organization → Templates
  3. According to Foreman bug report #2215 "PXE Localboot Default" is enough, but it didn't fix my issue. When I enabled debugging in Foreman, I came by the query SELECT "config_templates".* FROM "config_templates" WHERE "config_templates"."id" IN (49, 46, 44, 14, 15, 1, 39, 47, 45, 41, 40, 35, 33, 34, 28, 36, 30, 37, 48) AND "config_templates"."name" = 'PXELinux default local boot' ORDER BY config_templates.name LIMIT 1. So the missing template that caused days of headache was actually called PXELinux default local boot

Can't start the celerybeat service

systemctl start pulp_celerybeat leads to:

celery: ERROR: Pidfile (celerybeat.pid) already exists.
celery: Seems we're already running? (pid: 1476)
celery: celery beat v3.1.11 (Cipater) is starting.
systemd: pulp_celerybeat.service: main process exited, code=exited, status=73/n/a
systemd: Unit pulp_celerybeat.service entered failed state.

.

The pid file is stored in /var/lib/pulp/celery/celerybeat.pid. Remove it and run systemctl start pulp_celerybeat.

Can't create a new host because the PTR record already exists

  1. Find the offending record in /var/named/dynamic/db.100.168.192.in-addr.arpa and
  2. delete the PTR record with nsupdate:

    echo "server 127.0.0.1 update delete 100.100.168.192.in-addr.arpa PTR host.example.com send " | nsupdate -k /etc/rndc.key

Can't execute any of the rpm subcommands with pulp-admin

Install the missing packages packages: yum install pulp-admin-client pulp-rpm-admin-extensions.noarch pulp-rpm-handlers.noarch as described in How to deploy and use pulp-admin.

Warning: The pulp-admin command can easily corrupt your database or put the pulp or katello databases out of sync. The use of pulp-admin outside the scope and direction of Red Hat Global Support Services is unsupported.

Remove all tasks in error state with foreman-rake console

ForemanTasks::Task.where(:result => :error).destroy_all. Change :result => :error to :state => :pending to remove pending tasks. See Red Hat KB solution #1381053.

Trying to change a host's Content View via https://satellite.example.com/hosts/hostname.example.com/edit fails with the message Katello::Resources::Candlepin::Consumer: 410 Gone {"displayMessage":"Unit xxx has been deleted","requestUuid":"yyy","deletedId":"xxx"} (GET /candlepin/consumers/xxx)

Remove the host from the Foreman Postgres database:

  1. su - postgres
  2. psql foreman
  3. foreman=# select id, name from katello_systems where name = 'host.example.com', note down the ID of the host
  4. foreman=# delete from katello_system_activation_keys where system_id = 123, 123 is the ID we got in the previous query
  5. foreman=# delete from katello_system_errata where system_id = 123;
  6. foreman=# delete from katello_systems where name = 'host.example.com'

Now you can update the Content View of the host.

Similar as above: to remove all hosts that use a Content View that's causing 410: Gone errors

  1. su - postgres
  2. psql foreman
  3. foreman=# select id, name from katello_content_views where name like '%content view%';, note down the ID of the host
  4. foreman=# delete from katello_system_activation_keys where (system_id) in (select id from katello_systems where content_view_id = 123);, 123 is the ID we got in the previous query
  5. foreman=# delete from katello_system_errata where (system_id) in (select id from katello_systems where content_view_id = 123);
  6. foreman=# delete from katello_system_repositories where (system_id) in (select id from katello_systems where content_view_id = 123);
  7. foreman=# delete from katello_systems where content_view = 123;

Search queries for Content Hosts view

content_view:"Your content view name" AND (environment:"your environment")

Satellite clients can't install packages because the URL in /etc/yum.repos.d/*.repo is incorrect

(Re-)run subscription-manager config --rhsm.baseurl=https://satellite.example.com/pulp/repos to correct the URL.

Tagged , , , , , , ,

Fixed NIC names (eth\*) on RHEL and CentOS

Tristan Terpelle Summary: How to go back to the classic naming of eth devices on EL7

EL7 uses systemd magic to give network devices consistent and predictable names based on firmware, topology, and location information. But what if you just want the NICs in your VMware virtual machine to be named eth0, eth1, ... based on their MAC address?

In bug 1046302 it says to use a different naming scheme than "eth". The CentOS 7 FAQ (and articles by Red Hat as well) tell you to use the boot options net.ifnames=0 biosdevname=0 to get the old naming scheme back.

When I did this, udev was unable to rename my devices to what I wanted, because the target name already existed, as mentioned in the bug report:

Jun 24 10:26:52 example systemd-udevd[388]: error changing net interface name eth0 to eth1: File exists

The fix was simple: use the new system together with udev rules.

  1. add net.ifnames=1 biosdevname=1 to GRUB_CMDLINE_LINUX in /etc/default/grub
  2. rebuild the GRUB configuration with grub2-mkconfig -o /boot/grub2/grub.cfg
  3. create /etc/udev/rules.d/70-persistent-net.rules and add some lines like
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:11:22:33:44:55", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="22:33:44:55:66:77", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
  1. reboot

In your boot logs you will see:

...
Jun 24 11:40:57 example systemd-udevd[271]: renamed network interface eth0 to ens256
...
Jun 24 11:40:59 example systemd-udevd[580]: renamed network interface ens256 to eth1

This has only been tested with VMware virtual machines, I don't know (yet) how it works on bare metal machines.

Tagged , , , , , , ,

VMware Workstation 9.0.1 on Debian with kernel 3.10

New major Linux kernel version, new major breakage of VMware Workstation. Here's what and how to patch to be able to compile VMware's modules so you can run your virtual machines under Linux kernel 3.10.

vmnet

The compilation of the vmnet.ko module fails, a patch found on the VMware Community forum fixes this.

It has to be applied to the contents of /usr/lib/vmware/modules/source/vmnet.tar. You can find the instructions on how to do this in my older post.

vmblock

After the first patch, we're still not out of the woods: the vmblock.ko won't compile either. In the same thread a link is provided to a blog post with the appropriate patch. This time, the patch has to be applied to the files in /usr/lib/vmware/modules/source/vmblock.tar.

Compile

Now you can compile the modules with vmware-modconfig --console --install-all, provided you installed the appropriate kernel header files for your kernel. In my case, the packages I needed were:

ii  linux-headers-3.10-2-amd64            3.10.7-1                         amd64        Header files for Linux 3.10-2-amd64
ii  linux-headers-3.10-2-common           3.10.7-1                         amd64        Common header files for Linux 3.10-2
ii  linux-image-3.10-2-amd64              3.10.7-1                         amd64        Linux 3.10 for 64-bit PCs

Sources

Tagged , , ,

VMware Workstation 9.0.1 on Debian with kernel 3.8

Missing C header files

I installed VMware Workstation 9.0 on a fresh Debian Jessie/Sid installation, but when I ran it after the installation, I was greeted with the error message:

C header files matching your running kernel were not found.  Refer to your distribution's documentation for installation instructions.

and a dialog to locate said missing headers manually.

I found the fix to this annoying issue on ArchLinux' Wiki. The directory structure of the header files has changed since Linux kernel 3.7, so the installer cannot find the file it's looking for. A simple symlink resolves this.

# ln -sv /usr/src/linux-headers-$(uname -r)/include/generated/uapi/linux/version.h /usr/src/linux-headers-$(uname -r)/include/linux
‘/usr/src/linux-headers-3.8-1-amd64/include/linux/version.h’ -> ‘/usr/src/linux-headers-3.8-1-amd64/include/generated/uapi/linux/version.h’

Now VMware Workstation would at least try to compile the kernel modules!

Error compiling kernel modules

But failed miserably in the process:

Using 2.6.x kernel build system.
make: Entering directory `/tmp/modconfig-rWaQRn/vmci-only'
/usr/bin/make -C /lib/modules/3.8-1-amd64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
   MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-headers-3.8-1-amd64'
  CC [M]  /tmp/modconfig-rWaQRn/vmci-only/linux/driver.o
  CC [M]  /tmp/modconfig-rWaQRn/vmci-only/linux/vmciKernelIf.o
  CC [M]  /tmp/modconfig-rWaQRn/vmci-only/common/vmciContext.o
  CC [M]  /tmp/modconfig-rWaQRn/vmci-only/common/vmciDatagram.o
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:127:4: error: implicit declaration of function __devexit_p [-Werror=implicit-function-declaration]
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:127:4: error: initializer element is not constant
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:127:4: error: (near initialization for vmci_driver.remove)
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:1754:1: error: expected =, ,, ;, asm or __attribute__ before vmci_probe_device
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:1982:1: error: expected =, ,, ;, asm or __attribute__ before vmci_remove_device
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:119:12: warning: vmci_probe_device used but never defined [enabled by default]
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:121:13: warning: vmci_remove_device used but never defined [enabled by default]
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:2063:1: warning: vmci_interrupt defined but not used [-Wunused-function]
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:2137:1: warning: vmci_interrupt_bm defined but not used [-Wunused-function]
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:1717:1: warning: vmci_enable_msix defined but not used [-Wunused-function]
cc1: some warnings being treated as errors
make[4]: *** [/tmp/modconfig-rWaQRn/vmci-only/linux/driver.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [_module_/tmp/modconfig-rWaQRn/vmci-only] Error 2
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.8-1-amd64'
make: *** [vmci.ko] Error 2
make: Leaving directory `/tmp/modconfig-rWaQRn/vmci-only'
Failed to build vmci.  Failed to execute the build command.
Using 2.6.x kernel build system.
make: Entering directory `/tmp/modconfig-rWaQRn/vmci-only'
/usr/bin/make -C /lib/modules/3.8-1-amd64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
   MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-headers-3.8-1-amd64'
  CC [M]  /tmp/modconfig-rWaQRn/vmci-only/linux/driver.o
  CC [M]  /tmp/modconfig-rWaQRn/vmci-only/common/vmciDoorbell.o
  CC [M]  /tmp/modconfig-rWaQRn/vmci-only/common/vmciDriver.o
  CC [M]  /tmp/modconfig-rWaQRn/vmci-only/common/vmciEvent.o
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:127:4: error: implicit declaration of function __devexit_p [-Werror=implicit-function-declaration]
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:127:4: error: initializer element is not constant
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:127:4: error: (near initialization for vmci_driver.remove)
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:1754:1: error: expected =, ,, ;, asm or __attribute__ before vmci_probe_device
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:1982:1: error: expected =, ,, ;, asm or __attribute__ before vmci_remove_device
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:119:12: warning: vmci_probe_device used but never defined [enabled by default]
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:121:13: warning: vmci_remove_device used but never defined [enabled by default]
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:2063:1: warning: vmci_interrupt defined but not used [-Wunused-function]
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:2137:1: warning: vmci_interrupt_bm defined but not used [-Wunused-function]
/tmp/modconfig-rWaQRn/vmci-only/linux/driver.c:1717:1: warning: vmci_enable_msix defined but not used [-Wunused-function]
cc1: some warnings being treated as errors
make[4]: *** [/tmp/modconfig-rWaQRn/vmci-only/linux/driver.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [_module_/tmp/modconfig-rWaQRn/vmci-only] Error 2
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.8-1-amd64'
make: *** [vmci.ko] Error 2
make: Leaving directory `/tmp/modconfig-rWaQRn/vmci-only'
Failed to build vmci.  Failed to execute the build command.

The contents of /usr/lib/vmware/modules/source/vmci.tar needed to be patched, according to this thread on the VMware forums.

# wget -O /tmp/vmware9.k3.8rc4.patch http://communities.vmware.com/servlet/JiveServlet/download/2182440-102649/vmware9.k3.8rc4.patch
# cd /usr/lib/vmware/modules/source
# tar xf vmci.tar
# cd vmci-only
# patch -p1 < /tmp/vmware9.k3.8rc4.patch 
patching file linux/driver.c
# tar cf vmci.tar vmci-only
# rm -rf /usr/lib/vmware/modules/source/vmci-only

After that, I just had to run vmware as root and the modules were built successfully.

Sources

Tagged , , ,