1. Virt-who and virtual machine subscriptions
Virtual machines (VMs) require host-based Enterprise Linux subscriptions instead of physical subscriptions. Many host-based subscriptions include entitlements for unlimited VMs.
virt-who queries the virtualization platform and reports hypervisor and VM information to Foreman. You can view your subscription usage by using the Subscriptions service on the Red Hat Hybrid Cloud Console.
You can configure virt-who for the following virtualization platforms:
-
Enterprise Linux Virtualization (KVM)
-
VMware vSphere
-
Nutanix AHV
-
Microsoft Hyper-V
-
OpenStack
-
KubeVirt
1.1. virt-who configuration overview
You configure virt-who by creating a virt-who configuration on Foreman server. Then, you deploy the configuration on a target host such as a hypervisor or a dedicated Enterprise Linux server.
-
Import a subscription manifest that includes a host-based subscription into Foreman server.
-
Register the target host to Foreman server.
-
Create a read-only user for virt-who on the target host.
-
Create a virt-who configuration on Foreman server.
-
Deploy the virt-who configuration on the target host.
-
Set the system purpose attributes of the host to improve the accuracy of the subscriptions service data. For more information, see Editing the system purpose of a host in Managing hosts.
You can set the system purpose attributes when you configure activation keys for the host. For more information, see Managing activation keys in Managing content.
-
Associate the virtual machines with Foreman. For more information, see Associating a virtual machine with Foreman from a hypervisor in Managing hosts.
1.2. Checking for subscriptions that require virt-who
You can check for subscriptions that require virt-who configuration.
-
In the Foreman web UI, navigate to Content > Subscriptions.
-
Check the Requires Virt-Who column of the subscriptions list. If a tick is displayed, you must configure virt-who to use that subscription.
2. Configuring virt-who for Enterprise Linux Virtualization
You create a virt-who configuration for Enterprise Linux Virtualization by using the Foreman web UI or the CLI on Foreman server.
Then, you deploy the generated script or Hammer command on the hypervisors.
2.1. Creating a virt-who configuration
You can create a virt-who configuration for Enterprise Linux Virtualization by using the Foreman web UI.
To create a virt-who configuration by using the CLI, see CLI procedure.
The virt-who configuration creates a virt_who_reporter_1 user with the Virt-who Reporter role, which provides minimal permissions for virt-who reporting to Foreman server.
This user cannot be manually configured or used to log in to Foreman server.
Local configuration values are stored in the /etc/virt-who.d/conf_name.conf file.
These values apply only to the hypervisor.
Global configuration values are stored in the /etc/sysconfig/virt-who file
These values, which include Interval, Enable debugging output, HTTP Proxy, and Ignore Proxy, apply to all virt-who configurations on the same server.
Redeploying a virt-who configuration on the same server overwrites these values.
-
You have imported a subscription manifest that includes a host-based subscription into Foreman server. For more information, see Checking for subscriptions that require virt-who.
-
You have created a virt-who user with read-only access and a non-expiring password on the hypervisor.
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Click Create Config.
-
Complete the following fields:
-
Name: Configuration name.
-
Hypervisor Type: Select libvirt.
-
Interval: Virtual machine information reporting interval.
-
Foreman server FQDN.
-
Hypervisor ID: Select Hostname or UUID.
-
-
Optional: Filtering. Select one of the following options for querying hypervisors:
-
Unlimited (default): All hypervisors are queried.
-
Whitelist: Specific hypervisors are included.
-
Blacklist: Specific hypervisors are excluded.
-
Filter hosts: Comma-separated list of included hypervisors.
-
Exclude hosts: Comma-separated list of excluded hypervisors.
Specify the host name or UUID according to the hypervisor ID you selected.
Host names-
You can use wildcards, regular expressions, and special characters in the host name.
-
If you use regular expressions, you must escape the backslashes.
-
If you use special characters, you must enclose the host name in quotation marks.
-
-
-
-
You can configure the following logging and proxy options:
-
Enable debugging output: Enables debug logging for virt-who.
-
HTTP Proxy. Example:
http://proxy.example.com:3128.To use no proxy, leave this field blank; this has the same result as entering
*in the Ignore Proxy field. -
Ignore Proxy: Comma-separated list of host names, IP addresses, or domains to bypass existing proxy settings.
-
-
Click Submit.
-
On Foreman server, enter the
hammer virt-who-config createcommand:$ hammer virt-who-config create \ --name My_virt-who_Configuration \ --organizations "My_Organization" \ --interval 720 \ (1) --filtering-mode none \ (2) --hypervisor-id hostname \ (3) --hypervisor-type libvirt \ --hypervisor-server qemu+ssh://root@libvirt.example.com/system \ (4) --hypervisor-username virt_who_user \ (5) --proxy 'http://proxy.example.com:3128' \ (6) --satellite-url foreman.example.com
-
Optional: Specify the virtual machine information reporting interval, in minutes.
-
Specify
nonefor no filtering of hypervisors for virt-who queries. Specifywhitelistorblacklistto include or exclude hypervisors for virt-who queries. -
Specify
hostname,uuid, orhwuuidfor the hypervisor ID format.-
You can use
uuidto avoid duplication if you rename a hypervisor. -
You can use
hwuuidfor configurations that apply to a virtualization manager instead of an individual hypervisor.NoteYou cannot change
hwuuidto another option after virt-who starts running because this might cause duplicate entries in Subscription Manager.
-
-
Specify the FQDN or IP address of the hypervisor.
-
Specify the name of the virt-who user you created on the hypervisor.
-
Optional.
type=libvirt hypervisor_id=hostname owner=Default_Organization env=Library server=qemu+ssh://root@libvirt.example.com/system username=root encrypted_password=$cr_password rhsm_hostname=foreman.example.com rhsm_username=virt_who_reporter_1 rhsm_encrypted_password=$user_password rhsm_prefix=/rhsm
2.2. Deploying a virt-who configuration on a hypervisor
You deploy a virt-who configuration on a hypervisor to enable virtual machine subscription tracking. You download a virt-who configuration script from the Foreman web UI and then you run the script on the hypervisor.
Global configuration values apply to all virt-who configurations on this server and are overwritten if you deploy a new virt-who configuration.
-
You have registered the hypervisor to Foreman server.
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Click a virt-who configuration.
-
Click the Deploy tab.
-
Under Configuration script, click Download the script.
-
Copy the script from Foreman server to the hypervisor:
$ scp deploy_virt_who_config_1.sh root@hypervisor.example.com:
-
Log in to the hypervisor and make the script executable:
$ chmod +x deploy_virt_who_config_1.sh
-
Run the script:
$ sh deploy_virt_who_config_1.sh
-
After the deployment is complete, delete the script:
$ rm deploy_virt_who_config_1.sh
3. Configuring virt-who for VMware vSphere
You create a virt-who configuration for VMware vSphere by using the Foreman web UI or the CLI on Foreman server.
Then, you deploy the generated script or Hammer command on the Foreman server, Smart Proxy server, or on a dedicated Enterprise Linux server.
3.1. Creating a virt-who configuration
You can create a virt-who configuration for VMware vSphere by using the Foreman web UI.
To create a virt-who configuration by using the CLI, see CLI procedure.
The virt-who configuration creates a virt_who_reporter_1 user with the Virt-who Reporter role, which provides minimal permissions for virt-who reporting to Foreman server.
This user cannot be manually configured or used to log in to Foreman server.
Local configuration values are stored in the /etc/virt-who.d/conf_name.conf file.
These values apply only to the hypervisor.
Global configuration values are stored in the /etc/sysconfig/virt-who file
These values, which include Interval, Enable debugging output, HTTP Proxy, and Ignore Proxy, apply to all virt-who configurations on the same server.
Redeploying a virt-who configuration on the same server overwrites these values.
-
You have imported a subscription manifest that includes a host-based subscription into Foreman server. For more information, see Checking for subscriptions that require virt-who.
-
You have created a virt-who user with read-only access to all objects in the vCenter Data Center and a non-expiring password on the vCenter Server.
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Click Create Config.
-
Complete the following fields:
-
Name: Configuration name.
-
Hypervisor Type: Select VMware vSphere / vCenter (esx).
-
Hypervisor Server: FQDN or IP address.
-
Hypervisor Username: virt-who user name.
-
Hypervisor Password: virt-who user password. The password is encrypted when you deploy the configuration.
-
Interval: Virtual machine information reporting interval.
-
Foreman server FQDN.
-
Hypervisor ID: Select Hostname or UUID.
-
-
Optional: Filtering. Select one of the following options for querying hypervisors:
-
Unlimited (default): All hypervisors are queried.
-
Whitelist: Specific hypervisors are included.
-
Blacklist: Specific hypervisors are excluded.
-
Filter hosts: Comma-separated list of included hypervisors.
-
Exclude hosts: Comma-separated list of excluded hypervisors.
Specify the host name or UUID according to the hypervisor ID you selected.
Host names-
You can use wildcards, regular expressions, and special characters in the host name.
-
If you use regular expressions, you must escape the backslashes.
-
If you use special characters, you must enclose the host name in quotation marks.
-
-
-
Filter host parents: Comma-separated list of included cluster IDs.
-
Exclude host parents: Comma-separated list of excluded cluster IDs.
-
-
You can configure the following logging and proxy options:
-
Enable debugging output: Enables debug logging for virt-who.
-
HTTP Proxy. Example:
http://proxy.example.com:3128.To use no proxy, leave this field blank; this has the same result as entering
*in the Ignore Proxy field. -
Ignore Proxy: Comma-separated list of host names, IP addresses, or domains to bypass existing proxy settings.
-
-
Click Submit.
-
On Foreman server, enter the
hammer virt-who-config createcommand:$ hammer virt-who-config create \ --name My_virt-who_Configuration \ --organizations "My_Organization" \ --interval 720 \ (1) --filtering-mode none \ (2) --hypervisor-id hostname \ (3) --hypervisor-type esx \ --hypervisor-server vcenter.example.com \ (4) --hypervisor-username virt_who_user \ (5) --hypervisor-password <password> --proxy 'http://proxy.example.com:3128' \ (6) --satellite-url foreman.example.com
-
Optional: Specify the virtual machine information reporting interval, in minutes.
-
Specify
nonefor no filtering of hypervisors for virt-who queries. Specifywhitelistorblacklistto include or exclude hypervisors for virt-who queries. -
Specify
hostname,uuid, orhwuuidfor the hypervisor ID format.-
You can use
uuidto avoid duplication if you rename a hypervisor. -
You can use
hwuuidfor configurations that apply to a virtualization manager instead of an individual hypervisor.NoteYou cannot change
hwuuidto another option after virt-who starts running because this might cause duplicate entries in Subscription Manager.
-
-
Specify the FQDN or IP address of the vCenter Server.
-
Specify the name of the virt-who user you created on the hypervisor.
-
Optional.
type=esx hypervisor_id=hostname owner=Default_Organization env=Library server=vcenter.example.com username=username_vcenter@example.com encrypted_password=$cr_password rhsm_hostname=foreman.example.com rhsm_username=virt_who_reporter_1 rhsm_encrypted_password=$user_password rhsm_prefix=/rhsm
3.2. Deploying a virt-who configuration on Foreman server
You deploy a virt-who configuration on Foreman server to enable virtual machine subscription tracking. You download a virt-who configuration script from the Foreman web UI and then you run the script on Foreman server.
Global configuration values apply to all virt-who configurations on this server and are overwritten if you deploy a new virt-who configuration.
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Click a virt-who configuration.
-
Click the Deploy tab.
-
Under Hammer command, click Copy to clipboard.
-
Log in to Foreman server, paste the Hammer command into your terminal, and then run the command.
3.3. Deploying a virt-who configuration on Smart Proxy server
You deploy a virt-who configuration on Smart Proxy server to enable virtual machine subscription tracking. You download a virt-who configuration script from the Foreman web UI and then you run the script on Smart Proxy server.
Global configuration values apply to all virt-who configurations on this server and are overwritten if you deploy a new virt-who configuration.
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Click a virt-who configuration.
-
Click the Deploy tab.
-
Under Configuration script, click Download the script.
-
Copy the script from Foreman server to Smart Proxy server:
$ scp deploy_virt_who_config_1.sh root@smartproxy.example.com:
-
Log in to Smart Proxy server and make the script executable:
$ chmod +x deploy_virt_who_config_1.sh
-
Run the script:
$ sh deploy_virt_who_config_1.sh
-
After the deployment is complete, delete the script:
$ rm deploy_virt_who_config_1.sh
3.4. Deploying a virt-who configuration on a dedicated Enterprise Linux server
You deploy a virt-who configuration on a dedicated Enterprise Linux server to enable virtual machine subscription tracking. You download a virt-who configuration script from the Foreman web UI and then you run the script on the Enterprise Linux server.
The server can be physical or virtual.
Global configuration values apply to all virt-who configurations on this server and are overwritten if you deploy a new virt-who configuration.
-
You have registered the Enterprise Linux server to Foreman server. For more information, see Registering hosts by using global registration in Managing hosts.
-
Log in to the Enterprise Linux server.
-
Add a TCP port for communication between virt-who and Foreman server to the runtime configuration:
$ firewall-cmd --add-port="443/tcp"
-
Add a TCP port for communication between virt-who and Foreman server to the permanent configuration:
$ firewall-cmd --add-port="443/tcp" --permanent
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Click a virt-who configuration.
-
Click the Deploy tab.
-
Under Configuration script, click Download the script.
-
Copy the script from Foreman server to the Enterprise Linux server:
$ scp deploy_virt_who_config_1.sh root@server.example.com:
-
Log in to the Enterprise Linux server and make the script executable:
$ chmod +x deploy_virt_who_config_1.sh
-
Run the script:
$ sh deploy_virt_who_config_1.sh
-
After the deployment is complete, delete the script:
$ rm deploy_virt_who_config_1.sh
4. Configuring virt-who for Nutanix AHV
You create a virt-who configuration for Nutanix AHV by using the Foreman web UI or the CLI on Foreman server.
Then, you deploy the generated script or Hammer command on the Foreman server, Smart Proxy server, or on a dedicated Enterprise Linux server.
4.1. Creating a virt-who configuration
You can create a virt-who configuration for Nutanix AHV by using the Foreman web UI.
To create a virt-who configuration by using the CLI, see CLI procedure.
The virt-who configuration creates a virt_who_reporter_1 user with the Virt-who Reporter role, which provides minimal permissions for virt-who reporting to Foreman server.
This user cannot be manually configured or used to log in to Foreman server.
Local configuration values are stored in the /etc/virt-who.d/conf_name.conf file.
These values apply only to the hypervisor.
Global configuration values are stored in the /etc/sysconfig/virt-who file
These values, which include Interval, Enable debugging output, HTTP Proxy, and Ignore Proxy, apply to all virt-who configurations on the same server.
Redeploying a virt-who configuration on the same server overwrites these values.
-
You have imported a subscription manifest that includes a host-based subscription into Foreman server. For more information, see Checking for subscriptions that require virt-who.
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Click Create Config.
-
Complete the following fields:
-
Name: Configuration name.
-
Hypervisor Type: Select Nutanix AHV (ahv).
-
Interval: Virtual machine information reporting interval.
-
Foreman server FQDN.
-
Hypervisor ID: Select Hostname or UUID.
-
-
Optional: Filtering. Select one of the following options for querying hypervisors:
-
Unlimited (default): All hypervisors are queried.
-
Whitelist: Specific hypervisors are included.
-
Blacklist: Specific hypervisors are excluded.
-
Filter hosts: Comma-separated list of included hypervisors.
-
Exclude hosts: Comma-separated list of excluded hypervisors.
Specify the host name or UUID according to the hypervisor ID you selected.
Host names-
You can use wildcards, regular expressions, and special characters in the host name.
-
If you use regular expressions, you must escape the backslashes.
-
If you use special characters, you must enclose the host name in quotation marks.
-
-
-
-
You can configure the following logging and proxy options:
-
Enable debugging output: Enables debug logging for virt-who.
-
HTTP Proxy. Example:
http://proxy.example.com:3128.To use no proxy, leave this field blank; this has the same result as entering
*in the Ignore Proxy field. -
Ignore Proxy: Comma-separated list of host names, IP addresses, or domains to bypass existing proxy settings.
-
-
Select Prism Central or Prism Element from the Prism Flavor list.
-
Optional: Enable AHV Debug: Enables AHV internal debugging. This option provides additional AHV information when you enable both debugging options.
-
Click Submit.
-
On Foreman server, enter the
hammer virt-who-config createcommand:$ hammer virt-who-config create \ --name My_virt-who_Configuration \ --organizations "My_Organization" \ --interval 720 \ (1) --filtering-mode none \ (2) --hypervisor-id hostname \ (3) --hypervisor-type ahv \ --hypervisor-server prism.example.com \ (4) --hypervisor-username virt_who_user \ (5) --proxy 'http://proxy.example.com:3128' \ (6) --satellite-url foreman.example.com
-
Optional: Specify the virtual machine information reporting interval, in minutes.
-
Specify
nonefor no filtering of hypervisors for virt-who queries. Specifywhitelistorblacklistto include or exclude hypervisors for virt-who queries. -
Specify
hostname,uuid, orhwuuidfor the hypervisor ID format.-
You can use
uuidto avoid duplication if you rename a hypervisor. -
You can use
hwuuidfor configurations that apply to a virtualization manager instead of an individual hypervisor.NoteYou cannot change
hwuuidto another option after virt-who starts running because this might cause duplicate entries in Subscription Manager.
-
-
Specify the FQDN or IP address of the hypervisor.
-
Specify the name of the virt-who user you created on the hypervisor.
-
Optional.
type=ahv hypervisor_id=hostname prism_central=true owner=Default_Organization env=Library server=prism.example.com username=prism_user encrypted_password=$cr_password rhsm_hostname=foreman.example.com rhsm_username=virt_who_reporter_1 rhsm_encrypted_password=$user_password rhsm_prefix=/rhsm
4.2. Deploying a virt-who configuration on Foreman server
You deploy a virt-who configuration on Foreman server to enable virtual machine subscription tracking. You download a virt-who configuration script from the Foreman web UI and then you run the script on Foreman server.
Global configuration values apply to all virt-who configurations on this server and are overwritten if you deploy a new virt-who configuration.
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Click a virt-who configuration.
-
Click the Deploy tab.
-
Under Hammer command, click Copy to clipboard.
-
Log in to Foreman server, paste the Hammer command into your terminal, and then run the command.
4.3. Deploying a virt-who configuration on Smart Proxy server
You deploy a virt-who configuration on Smart Proxy server to enable virtual machine subscription tracking. You download a virt-who configuration script from the Foreman web UI and then you run the script on Smart Proxy server.
Global configuration values apply to all virt-who configurations on this server and are overwritten if you deploy a new virt-who configuration.
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Click a virt-who configuration.
-
Click the Deploy tab.
-
Under Configuration script, click Download the script.
-
Copy the script from Foreman server to Smart Proxy server:
$ scp deploy_virt_who_config_1.sh root@smartproxy.example.com:
-
Log in to Smart Proxy server and make the script executable:
$ chmod +x deploy_virt_who_config_1.sh
-
Run the script:
$ sh deploy_virt_who_config_1.sh
-
After the deployment is complete, delete the script:
$ rm deploy_virt_who_config_1.sh
4.4. Deploying a virt-who configuration on a dedicated Enterprise Linux server
You deploy a virt-who configuration on a dedicated Enterprise Linux server to enable virtual machine subscription tracking. You download a virt-who configuration script from the Foreman web UI and then you run the script on the Enterprise Linux server.
The server can be physical or virtual.
Global configuration values apply to all virt-who configurations on this server and are overwritten if you deploy a new virt-who configuration.
-
You have registered the Enterprise Linux server to Foreman server. For more information, see Registering hosts by using global registration in Managing hosts.
-
Log in to the Enterprise Linux server.
-
Add a TCP port for communication between virt-who and Foreman server to the runtime configuration:
$ firewall-cmd --add-port="443/tcp"
-
Add a TCP port for communication between virt-who and Foreman server to the permanent configuration:
$ firewall-cmd --add-port="443/tcp" --permanent
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Click a virt-who configuration.
-
Click the Deploy tab.
-
Under Configuration script, click Download the script.
-
Copy the script from Foreman server to the Enterprise Linux server:
$ scp deploy_virt_who_config_1.sh root@server.example.com:
-
Log in to the Enterprise Linux server and make the script executable:
$ chmod +x deploy_virt_who_config_1.sh
-
Run the script:
$ sh deploy_virt_who_config_1.sh
-
After the deployment is complete, delete the script:
$ rm deploy_virt_who_config_1.sh
5. Configuring virt-who for Microsoft Hyper-V
You create a virt-who configuration for Microsoft Hyper-V by using the Foreman web UI or the CLI on Foreman server.
Then, you deploy the generated script or Hammer command on the Foreman server, Smart Proxy server, or on a dedicated Enterprise Linux server.
5.1. Creating a virt-who configuration
You can create a virt-who configuration for Microsoft Hyper-V by using the Foreman web UI.
To create a virt-who configuration by using the CLI, see CLI procedure.
The virt-who configuration creates a virt_who_reporter_1 user with the Virt-who Reporter role, which provides minimal permissions for virt-who reporting to Foreman server.
This user cannot be manually configured or used to log in to Foreman server.
Local configuration values are stored in the /etc/virt-who.d/conf_name.conf file.
These values apply only to the hypervisor.
Global configuration values are stored in the /etc/sysconfig/virt-who file
These values, which include Interval, Enable debugging output, HTTP Proxy, and Ignore Proxy, apply to all virt-who configurations on the same server.
Redeploying a virt-who configuration on the same server overwrites these values.
-
You have imported a subscription manifest that includes a host-based subscription into Foreman server. For more information, see Checking for subscriptions that require virt-who.
-
You have created a virt-who user with read-only access and a non-expiring password on the hypervisor.
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Click Create Config.
-
Complete the following fields:
-
Name: Configuration name.
-
Hypervisor Type: Select Microsoft Hyper-V (hyperv).
-
Interval: Virtual machine information reporting interval.
-
Foreman server FQDN.
-
Hypervisor ID: Select Hostname or UUID.
-
-
Optional: Filtering. Select one of the following options for querying hypervisors:
-
Unlimited (default): All hypervisors are queried.
-
Whitelist: Specific hypervisors are included.
-
Blacklist: Specific hypervisors are excluded.
-
Filter hosts: Comma-separated list of included hypervisors.
-
Exclude hosts: Comma-separated list of excluded hypervisors.
Specify the host name or UUID according to the hypervisor ID you selected.
Host names-
You can use wildcards, regular expressions, and special characters in the host name.
-
If you use regular expressions, you must escape the backslashes.
-
If you use special characters, you must enclose the host name in quotation marks.
-
-
-
-
You can configure the following logging and proxy options:
-
Enable debugging output: Enables debug logging for virt-who.
-
HTTP Proxy. Example:
http://proxy.example.com:3128.To use no proxy, leave this field blank; this has the same result as entering
*in the Ignore Proxy field. -
Ignore Proxy: Comma-separated list of host names, IP addresses, or domains to bypass existing proxy settings.
-
-
Click Submit.
-
On Foreman server, enter the
hammer virt-who-config createcommand:$ hammer virt-who-config create \ --name My_virt-who_Configuration \ --organizations "My_Organization" \ --interval 720 \ (1) --filtering-mode none \ (2) --hypervisor-id hostname \ (3) --hypervisor-type hyperv \ --hypervisor-server hypervisor.example.com \ (4) --hypervisor-username virt_who_user \ (5) --hypervisor-password <password> --proxy 'http://proxy.example.com:3128' \ (6) --satellite-url foreman.example.com
-
Optional: Specify the virtual machine information reporting interval, in minutes.
-
Specify
nonefor no filtering of hypervisors for virt-who queries. Specifywhitelistorblacklistto include or exclude hypervisors for virt-who queries. -
Specify
hostname,uuid, orhwuuidfor the hypervisor ID format.-
You can use
uuidto avoid duplication if you rename a hypervisor. -
You can use
hwuuidfor configurations that apply to a virtualization manager instead of an individual hypervisor.NoteYou cannot change
hwuuidto another option after virt-who starts running because this might cause duplicate entries in Subscription Manager.
-
-
Specify the FQDN or IP address of the hypervisor.
-
Specify the name of the virt-who user you created on the hypervisor.
-
Optional.
type=hyperv hypervisor_id=hostname owner=Default_Organization env=Library server=hypervisor.example.com username=virt_who_user encrypted_password=$cr_password rhsm_hostname=foreman.example.com rhsm_username=virt_who_reporter_1 rhsm_encrypted_password=$user_password rhsm_prefix=/rhsm
5.2. Deploying a virt-who configuration on Foreman server
You deploy a virt-who configuration on Foreman server to enable virtual machine subscription tracking. You download a virt-who configuration script from the Foreman web UI and then you run the script on Foreman server.
Global configuration values apply to all virt-who configurations on this server and are overwritten if you deploy a new virt-who configuration.
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Click a virt-who configuration.
-
Click the Deploy tab.
-
Under Hammer command, click Copy to clipboard.
-
Log in to Foreman server, paste the Hammer command into your terminal, and then run the command.
5.3. Deploying a virt-who configuration on Smart Proxy server
You deploy a virt-who configuration on Smart Proxy server to enable virtual machine subscription tracking. You download a virt-who configuration script from the Foreman web UI and then you run the script on Smart Proxy server.
Global configuration values apply to all virt-who configurations on this server and are overwritten if you deploy a new virt-who configuration.
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Click a virt-who configuration.
-
Click the Deploy tab.
-
Under Configuration script, click Download the script.
-
Copy the script from Foreman server to Smart Proxy server:
$ scp deploy_virt_who_config_1.sh root@smartproxy.example.com:
-
Log in to Smart Proxy server and make the script executable:
$ chmod +x deploy_virt_who_config_1.sh
-
Run the script:
$ sh deploy_virt_who_config_1.sh
-
After the deployment is complete, delete the script:
$ rm deploy_virt_who_config_1.sh
5.4. Deploying a virt-who configuration on a dedicated Enterprise Linux server
You deploy a virt-who configuration on a dedicated Enterprise Linux server to enable virtual machine subscription tracking. You download a virt-who configuration script from the Foreman web UI and then you run the script on the Enterprise Linux server.
The server can be physical or virtual.
Global configuration values apply to all virt-who configurations on this server and are overwritten if you deploy a new virt-who configuration.
-
You have registered the Enterprise Linux server to Foreman server. For more information, see Registering hosts by using global registration in Managing hosts.
-
Log in to the Enterprise Linux server.
-
Add a TCP port for communication between virt-who and Foreman server to the runtime configuration:
$ firewall-cmd --add-port="5985/tcp"
-
Add a TCP port for communication between virt-who and Foreman server to the permanent configuration:
$ firewall-cmd --add-port="5985/tcp" --permanent
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Click a virt-who configuration.
-
Click the Deploy tab.
-
Under Configuration script, click Download the script.
-
Copy the script from Foreman server to the Enterprise Linux server:
$ scp deploy_virt_who_config_1.sh root@server.example.com:
-
Log in to the Enterprise Linux server and make the script executable:
$ chmod +x deploy_virt_who_config_1.sh
-
Run the script:
$ sh deploy_virt_who_config_1.sh
-
After the deployment is complete, delete the script:
$ rm deploy_virt_who_config_1.sh
6. Configuring virt-who for OpenStack
You create a virt-who configuration for OpenStack by using the Foreman web UI or the CLI on Foreman server.
Then, you deploy the generated script or Hammer command on the hypervisor.
6.1. Creating a virt-who configuration
You can create a virt-who configuration for OpenStack by using the Foreman web UI.
To create a virt-who configuration by using the CLI, see CLI procedure.
The virt-who configuration creates a virt_who_reporter_1 user with the Virt-who Reporter role, which provides minimal permissions for virt-who reporting to Foreman server.
This user cannot be manually configured or used to log in to Foreman server.
Local configuration values are stored in the /etc/virt-who.d/conf_name.conf file.
These values apply only to the hypervisor.
Global configuration values are stored in the /etc/sysconfig/virt-who file
These values, which include Interval, Enable debugging output, HTTP Proxy, and Ignore Proxy, apply to all virt-who configurations on the same server.
Redeploying a virt-who configuration on the same server overwrites these values.
-
You have imported a subscription manifest that includes a host-based subscription into Foreman server. For more information, see Checking for subscriptions that require virt-who.
-
You have created a virt-who user with read-only access and a non-expiring password on the hypervisor.
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Click Create Config.
-
Complete the following fields:
-
Name: Configuration name.
-
Hypervisor Type: Select libvirt.
-
Interval: Virtual machine information reporting interval.
-
Foreman server FQDN.
-
Hypervisor ID: Select Hostname or UUID.
-
-
Optional: Filtering. Select one of the following options for querying hypervisors:
-
Unlimited (default): All hypervisors are queried.
-
Whitelist: Specific hypervisors are included.
-
Blacklist: Specific hypervisors are excluded.
-
Filter hosts: Comma-separated list of included hypervisors.
-
Exclude hosts: Comma-separated list of excluded hypervisors.
Specify the host name or UUID according to the hypervisor ID you selected.
Host names-
You can use wildcards, regular expressions, and special characters in the host name.
-
If you use regular expressions, you must escape the backslashes.
-
If you use special characters, you must enclose the host name in quotation marks.
-
-
-
-
You can configure the following logging and proxy options:
-
Enable debugging output: Enables debug logging for virt-who.
-
HTTP Proxy. Example:
http://proxy.example.com:3128.To use no proxy, leave this field blank; this has the same result as entering
*in the Ignore Proxy field. -
Ignore Proxy: Comma-separated list of host names, IP addresses, or domains to bypass existing proxy settings.
-
-
Click Submit.
-
On Foreman server, enter the
hammer virt-who-config createcommand:$ hammer virt-who-config create \ --name My_virt-who_Configuration \ --organizations "My_Organization" \ --interval 720 \ (1) --filtering-mode none \ (2) --hypervisor-id hostname \ (3) --hypervisor-type libvirt \ --hypervisor-server qemu:///system \ (4) --hypervisor-username virt_who_user \ (5) --proxy 'http://proxy.example.com:3128' \ (6) --satellite-url foreman.example.com
-
Optional: Specify the virtual machine information reporting interval, in minutes.
-
Specify
nonefor no filtering of hypervisors for virt-who queries. Specifywhitelistorblacklistto include or exclude hypervisors for virt-who queries. -
Specify
hostname,uuid, orhwuuidfor the hypervisor ID format.-
You can use
uuidto avoid duplication if you rename a hypervisor. -
You can use
hwuuidfor configurations that apply to a virtualization manager instead of an individual hypervisor.NoteYou cannot change
hwuuidto another option after virt-who starts running because this might cause duplicate entries in Subscription Manager.
-
-
Specify the FQDN or IP address of the hypervisor.
-
Specify the name of the virt-who user you created on the hypervisor.
-
Optional.
type=libvirt hypervisor_id=hostname owner=Default_Organization env=Library server=qemu:///system username=virt_who_user encrypted_password=$cr_password rhsm_hostname=foreman.example.com rhsm_username=virt_who_reporter_1 rhsm_encrypted_password=$user_password rhsm_prefix=/rhsm
6.2. Deploying a virt-who configuration on a hypervisor
You deploy a virt-who configuration on a hypervisor to enable virtual machine subscription tracking. You download a virt-who configuration script from the Foreman web UI and then you run the script on the hypervisor.
Global configuration values apply to all virt-who configurations on this server and are overwritten if you deploy a new virt-who configuration.
-
You have registered the hypervisor to Foreman server.
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Click a virt-who configuration.
-
Click the Deploy tab.
-
Under Configuration script, click Download the script.
-
Copy the script from Foreman server to the hypervisor:
$ scp deploy_virt_who_config_1.sh root@hypervisor.example.com:
-
Log in to the hypervisor and make the script executable:
$ chmod +x deploy_virt_who_config_1.sh
-
Run the script:
$ sh deploy_virt_who_config_1.sh
-
After the deployment is complete, delete the script:
$ rm deploy_virt_who_config_1.sh
7. Configuring virt-who for KubeVirt
You create a virt-who configuration for KubeVirt by using the Foreman web UI or the CLI on Foreman server.
Then, you deploy the generated script or Hammer command on the hypervisor.
7.1. Creating a virt-who configuration
You can create a virt-who configuration for KubeVirt by using the Foreman web UI.
To create a virt-who configuration by using the CLI, see CLI procedure.
The virt-who configuration creates a virt_who_reporter_1 user with the Virt-who Reporter role, which provides minimal permissions for virt-who reporting to Foreman server.
This user cannot be manually configured or used to log in to Foreman server.
Local configuration values are stored in the /etc/virt-who.d/conf_name.conf file.
These values apply only to the hypervisor.
Global configuration values are stored in the /etc/sysconfig/virt-who file
These values, which include Interval, Enable debugging output, HTTP Proxy, and Ignore Proxy, apply to all virt-who configurations on the same server.
Redeploying a virt-who configuration on the same server overwrites these values.
-
You have imported a subscription manifest that includes a host-based subscription into Foreman server. For more information, see Checking for subscriptions that require virt-who.
-
You have created a
kubeconfigfile.
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Click Create Config.
-
Complete the following fields:
-
Name: Configuration name.
-
Hypervisor Type: Select Container-native virtualization.
-
Interval: Virtual machine information reporting interval.
-
Foreman server FQDN.
-
Hypervisor ID: Select Hostname or UUID.
-
-
Optional: Filtering. Select one of the following options for querying hypervisors:
-
Unlimited (default): All hypervisors are queried.
-
Whitelist: Specific hypervisors are included.
-
Blacklist: Specific hypervisors are excluded.
-
Filter hosts: Comma-separated list of included hypervisors.
-
Exclude hosts: Comma-separated list of excluded hypervisors.
Specify the host name or UUID according to the hypervisor ID you selected.
Host names-
You can use wildcards, regular expressions, and special characters in the host name.
-
If you use regular expressions, you must escape the backslashes.
-
If you use special characters, you must enclose the host name in quotation marks.
-
-
-
-
You can configure the following logging and proxy options:
-
Enable debugging output: Enables debug logging for virt-who.
-
HTTP Proxy. Example:
http://proxy.example.com:3128.To use no proxy, leave this field blank; this has the same result as entering
*in the Ignore Proxy field. -
Ignore Proxy: Comma-separated list of host names, IP addresses, or domains to bypass existing proxy settings.
-
-
Enter the
kubeconfigfile path. -
Click Submit.
-
On Foreman server, enter the
hammer virt-who-config createcommand:$ hammer virt-who-config create \ --name My_virt-who_Configuration \ --organizations "My_Organization" \ --interval 720 \ (1) --filtering-mode none \ (2) --hypervisor-id hostname \ (3) --hypervisor-type cnv \ --hypervisor-server hypervisor.example.com \ (4) --hypervisor-username virt_who_user \ (5) --proxy 'http://proxy.example.com:3128' \ (6) --satellite-url foreman.example.com
-
Optional: Specify the virtual machine information reporting interval, in minutes.
-
Specify
nonefor no filtering of hypervisors for virt-who queries. Specifywhitelistorblacklistto include or exclude hypervisors for virt-who queries. -
Specify
hostname,uuid, orhwuuidfor the hypervisor ID format.-
You can use
uuidto avoid duplication if you rename a hypervisor. -
You can use
hwuuidfor configurations that apply to a virtualization manager instead of an individual hypervisor.NoteYou cannot change
hwuuidto another option after virt-who starts running because this might cause duplicate entries in Subscription Manager.
-
-
Specify the FQDN or IP address of the hypervisor.
-
Specify the name of the virt-who user you created on the hypervisor.
-
Optional.
type=cnv hypervisor_id=hostname owner=Default_Organization env=Library server=hypervisor.example.com username=virt_who_user encrypted_password=$cr_password rhsm_hostname=foreman.example.com rhsm_username=virt_who_reporter_1 rhsm_encrypted_password=$user_password rhsm_prefix=/rhsm
7.2. Deploying a virt-who configuration on a hypervisor
You deploy a virt-who configuration on a hypervisor to enable virtual machine subscription tracking. You download a virt-who configuration script from the Foreman web UI and then you run the script on the hypervisor.
Global configuration values apply to all virt-who configurations on this server and are overwritten if you deploy a new virt-who configuration.
-
You have registered the hypervisor to Foreman server.
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Click a virt-who configuration.
-
Click the Deploy tab.
-
Under Configuration script, click Download the script.
-
Copy the script from Foreman server to the hypervisor:
$ scp deploy_virt_who_config_1.sh root@hypervisor.example.com:
-
Log in to the hypervisor and make the script executable:
$ chmod +x deploy_virt_who_config_1.sh
-
Run the script:
$ sh deploy_virt_who_config_1.sh
-
After the deployment is complete, delete the script:
$ rm deploy_virt_who_config_1.sh
8. Editing a virt-who configuration
You can edit a virt-who configuration by using either the Foreman web UI or the Hammer CLI.
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Select Edit in the Actions column of a virt-who configuration.
-
Edit the fields and then click Submit.
-
Deploy the modified virt-who configuration.
-
On Foreman server, use the
hammer virt-who-config updatecommand to edit the virt-who configuration:$ hammer virt-who-config update \ --name My_virt-who_Configuration \ --new-name My_new_virt-who_Configuration \ --interval 1440
-
Deploy the modified virt-who configuration.
9. Removing a virt-who configuration
You can remove a virt-who configuration by deleting the configuration in the Foreman web UI and then by deleting the configuration file from the hypervisor or the virtualization manager.
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Select Delete from the Actions column of the virt-who configuration.
-
On the hypervisor or virtualization manager, remove the configuration file by running the following command:
$ rm /etc/virt-who.d/conf_name.conf
10. Troubleshooting virt-who
You can troubleshoot virt-who by checking the service status, logs, and by identifying configuration issues.
For more information, see Virt-who troubleshooting methods and Virt-who troubleshooting scenarios in Getting Started with RHEL System Registration in the Subscription Central documentation.
10.1. Checking virt-who status
You can check the status of virt-who by using the Foreman web UI or the Hammer CLI tool.
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Check the Status column of each virt-who instance.
The
OKstatus indicates that virt-who is successfully connecting to Foreman server and reporting the virtual machines managed by each hypervisor.
-
List the status of all virt-who instances by entering the following command on Foreman server:
$ hammer virt-who-config list
The output includes the date and time when each virt-who instance reported to Foreman server.
10.2. Enabling debug logging
You can enable debug logging for the /var/log/rhsm/rhsm.log file by using the Foreman web UI or the Hammer CLI tool.
After you resolve the problem, you must disable debug logging and redeploy the virt-who configuration. To use the CLI instead of the Foreman web UI, see the CLI procedure.
-
In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.
-
Select Edit in the Actions column of a virt-who configuration.
-
Select Enable debugging output.
-
Click Submit.
-
Redeploy the virt-who configuration on the target host.
-
On Foreman server, run the
hammer virt-who-config updatecommand with the debug option:$ hammer virt-who-config update \ --debug true
-
Redeploy the virt-who configuration on the target host.
10.3. virt-who does not report to Foreman server
virt-who might not report to Foreman server if Foreman server is configured to use a proxy server in rhsm.conf while virt-who is configured not to use a proxy server in /etc/sysconfig/virt-who.
The virt-who setting is ignored by the Subscription Manager. As a result, virt-who attempts to connect to Foreman server through a proxy server and fails.
To work around this problem, add the following parameter to the /etc/rhsm/rhsm.conf file:
no_proxy = server.example.com
10.4. Virt-who troubleshooting methods
If you have multiple virt-who configuration files on one server, move one file at a time to a different directory while testing after each file move. If the issue no longer occurs, the cause is associated with the most recently moved file. After you have resolved the issue, return the virt-who configuration files to their original location.
Alternatively, you can test an individual file after moving it by using the --config option to specify its location. For example:
$ virt-who --debug --one-shot --config /tmp/conf_name.conf
Duplicate hypervisors can cause subscription and entitlement errors. Enter the following commands to check for duplicate hypervisors:
# systemctl stop virt-who # virt-who -op >/tmp/virt-who.json # systemctl start virt-who # cat /tmp/virt-who.json | json_reformat | grep name | sort | uniq -c | sort -nr | head -n5 3 "name": "localhost" 1 "name": "rhel1.example.com" 1 "name": "rhel2.example.com" 1 "name": "rhel3.example.com" 1 "name": "rhel4.example.com"
In this example, three hypervisors have the same FQDN (localhost), and must be corrected to use unique FQDNs.
Enter the following commands to check for duplicate virtual machines:
# systemctl stop virt-who # virt-who -op >/tmp/virt-who.json # systemctl start virt-who # cat /tmp/virt-who.json | json_reformat | grep "guestId" | sort | uniq -c | sort -nr | head -n10
Enter the following commands to check the number of hypervisors virt-who currently reports:
# systemctl stop virt-who # virt-who -op >/tmp/virt-who.json # systemctl start virt-who # cat /tmp/virt-who.json | json_reformat | grep name | sort | uniq -c | wc -l
Enter the following commands to check the number of virtual machines that virt-who currently reports:
# systemctl stop virt-who # virt-who -op >/tmp/virt-who.json # systemctl start virt-who # cat /tmp/virt-who.json | json_reformat | grep "guestId" | sort | uniq -c | wc -l