Este contenido no está disponible en el idioma seleccionado.
Chapter 16. Registering the Hypervisor and Virtual Machine
- Subscriptions specific to virtual systems are readily available and can be applied to all of the associated guest VMs.
- All subscription benefits that can be inherited from the hypervisor are readily available and can be applied to all of the associated guest VMs.
Note
16.1. Installing virt-who on the Host Physical Machine
Register the KVM hypervisor
Register the KVM Hypervisor by running thesubscription-manager register [options]
command in a terminal as the root user on the host physical machine. More options are available using the #subscription-manager register --help
menu. In cases where you are using a user name and password, use the credentials that are known to the subscription manager. If this is your very first time subscribing and you do not have a user account, contact customer support. For example to register the VM as 'admin' with 'secret' as a password, you would send the following command:[root@rhel-server ~]#
subscription-manager register --username=admin --password=secret --auto-attach --type=hypervisor
Install the virt-who packages
Install the virt-who packages, by running the following command in a terminal as root on the host physical machine:[root@rhel-server ~]#
yum install virt-who
Create a virt-who configuration file
Add a configuration file in the/etc/virt-who.d/
directory. It does not matter what the name of the file is, but you should give it a name that makes sense and the file must be located in the/etc/virt-who.d/
directory. Inside that file add the following snippet and remember to save the file before closing it.[libvirt] type=libvirt
Start the virt-who service
Start the virt-who service by running the following command in a terminal as root on the host physical machine:[root@virt-who ~]# service virt-who start [root@virt-who ~]# chkconfig virt-who on
Confirm virt-who service is receiving guest information
At this point, the virt-who service will start collecting a list of domains from the host. Check the/var/log/rhsm/rhsm.log
file on the host physical machine to confirm that the file contains a list of the guest VMs. For example:2015-05-28 12:33:31,424 DEBUG: Libvirt domains found: [{'guestId': '58d59128-cfbb-4f2c-93de-230307db2ce0', 'attributes': {'active': 0, 'virtWhoType': 'libvirt', 'hypervisorType': 'QEMU'}, 'state': 5}]
Procedure 16.1. Managing the subscription on the customer portal
Subscribing the hypervisor
As the virtual machines will be receiving the same subscription benefits as the hypervisor, it is important that the hypervisor has a valid subscription and that the subscription is available for the VMs to use.Login to the customer portal
Login to the Red Hat customer portal https://access.redhat.com/ and click the button at the top of the page.Click the Systems link
In the Subscriber Inventory section (towards the bottom of the page), click Systems link.Select the hypervisor
On the Systems page, there is a table of all subscribed systems. Click on the name of the hypervisor (localhost.localdomain for example). In the details page that opens, click Attach a subscription and select all the subscriptions listed. Click . This will attach the host's physical subscription to the hypervisor so that the guests can benefit from the subscription.
Subscribing the guest virtual machines - first time use
This step is for those who have a new subscription and have never subscribed a guest virtual machine before. If you are adding virtual machines, skip this step. To consume the subscription assigned to the hypervisor profile on the machine running the virt-who service, auto subscribe by running the following command in a terminal, on the guest virtual machine as root.[root@virt-who ~]# subscription-manager attach --auto
Subscribing additional guest virtual machines
If you just subscribed a for the first time, skip this step. If you are adding additional virtual machines, it should be noted that running this command will not necessarily re-attach the same subscriptions to the guest virtual machine. This is because removing all subscriptions then allowing auto attach to resolve what is necessary for a given guest virtual machine may result in different subscriptions consumed than before. This may not have any effect on your system, but it is something you should be aware about. If you used a manual attachment procedure to attach the virtual machine, which is not described below, you will need to re-attach those virtual machines manually as the auto-attach will not work. Use the following command as root in a terminal to first remove the subscriptions for the old guests and then use the auto-attach to attach subscriptions to all the guests. Run these commands on the guest virtual machine.[root@virt-who ~]# subscription-manager remove --all [root@virt-who ~]# subscription-manager attach --auto
Confirm subscriptions are attached
Confirm that the subscription is attached to the hypervisor by running the following command as root in a terminal on the guest virtual machine:[root@virt-who ~]# subscription-manager list --consumed
Output similar to the following will be displayed. Pay attention to the Subscription Details. It should say 'Subscription is current'.[root@virt-who ~]#
subscription-manager
+-------------------------------------------+ Consumed Subscriptions +-------------------------------------------+ Subscription Name: Awesome OS with unlimited virtual guests Provides: Awesome OS Server Bits SKU: awesomeos-virt-unlimited Contract: 0 Account: ######### Your account number ##### Serial: ######### Your serial number ###### Pool ID: XYZ123 Provides Management: No Active: True Quantity Used: 1 Service Level: Service Type: Status Details: Subscription is current Subscription Type: Starts: 01/01/2015 Ends: 12/31/2015 System Type: Virtuallist --consumed
The ID for the subscription to attach to the system is displayed here. You will need this ID if you need to attach the subscription manually.Indicates if your subscription is current. If your subscription is not current, an error message appears. One example is Guest has not been reported on any host and is using a temporary unmapped guest subscription. In this case the guest needs to be subscribed. In other cases, use the information as indicated in Section 16.5.2, “I have subscription status errors, what do I do?”.Register additional guests
When you install new guest VMs on the hypervisor, you must register the new VM and use the subscription attached to the hypervisor, by running the following commands in a terminal as root on the guest virtual machine:[root@server1 ~]# subscription-manager register [root@server1 ~]# subscription-manager attach --auto [root@server1 ~]# subscription-manager list --consumed