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.

Preparing your environment
  • 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.

Virt-who configuration and deployment
  1. Create a virt-who configuration on Foreman server.

  2. Deploy the virt-who configuration on the target host.

Additional configuration

1.2. Checking for subscriptions that require virt-who

You can check for subscriptions that require virt-who configuration.

Procedure
  1. In the Foreman web UI, navigate to Content > Subscriptions.

  2. 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 by using the Foreman web UI

You can create a virt-who configuration for Enterprise Linux Virtualization by using the Foreman web UI.

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.

Prerequisites
  • 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.

Procedure
  1. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  2. Click Create Config.

  3. 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.

  4. Optional: Filtering. Select one of the following options for querying hypervisors:

    • Unlimited (default): All hypervisors are queried.

    • Whitelist: Specific hypervisors are included.

      • Filter hosts: Comma-separated list of included hypervisors.

    • Blacklist: Specific hypervisors are excluded.

      • Exclude hosts: Comma-separated list of excluded hypervisors.

    In the Filtering fields, specify the host name or UUID according to the hypervisor ID you selected. Follow these guidelines for 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.

  5. 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.

  6. Click Submit.

2.2. Creating a virt-who configuration by using Hammer CLI

You can create a virt-who configuration for Enterprise Linux Virtualization by using Hammer CLI.

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.

Prerequisites
  • 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.

Procedure
  • On Foreman server, enter the hammer virt-who-config create command:

    $ hammer virt-who-config create \
    --name My_virt-who_Configuration \
    --organizations "My_Organization" \
    --interval 720 \
    --filtering-mode none \
    --hypervisor-id hostname \
    --hypervisor-type libvirt \
    --hypervisor-server qemu+ssh://root@libvirt.example.com/system \
    --hypervisor-username virt_who_user \
    --satellite-url foreman.example.com

In this command, use the following options:

  • In --filtering-mode, specify none for no filtering of hypervisors for virt-who queries. Specify whitelist or blacklist to include or exclude hypervisors for virt-who queries.

  • In --hypervisor-id, specify hostname, uuid, or hwuuid for the hypervisor ID format.

    • You can use uuid to avoid duplication if you rename a hypervisor.

    • You can use hwuuid for configurations that apply to a virtualization manager instead of an individual hypervisor.

      Note

      You cannot change hwuuid to another option after virt-who starts running because this might cause duplicate entries in Subscription Manager.

  • In --hypervisor-server, specify the FQDN or IP address of the hypervisor.

  • In --hypervisor-username, specify the name of the virt-who user you created on the hypervisor.

  • Optionally, in the --proxy option, specify the proxy address and port, for example, --proxy 'http://proxy.example.com:3128'.

  • Optionally, in the --interval option, specify the virtual machine information reporting interval in minutes.

Example 1. Enterprise Linux Virtualization virt-who configuration
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.3. 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.

Prerequisites
  • You have registered the hypervisor to Foreman server.

Procedure
  1. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  2. Click a virt-who configuration.

  3. Click the Deploy tab.

  4. Under Configuration script, click Download the script.

  5. Copy the script from Foreman server to the hypervisor:

    $ scp deploy_virt_who_config_1.sh root@hypervisor.example.com:
  6. Log in to the hypervisor and make the script executable:

    $ chmod +x deploy_virt_who_config_1.sh
  7. Run the script:

    $ sh deploy_virt_who_config_1.sh
  8. 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 by using the Foreman web UI

You can create a virt-who configuration for VMware vSphere by using the Foreman web UI.

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.

Prerequisites
  • 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.

Procedure
  1. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  2. Click Create Config.

  3. 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.

  4. Optional: Filtering. Select one of the following options for querying hypervisors:

    • Unlimited (default): All hypervisors are queried.

    • Whitelist: Specific hypervisors are included.

      • Filter hosts: Comma-separated list of included hypervisors.

      • Filter host parents: Comma-separated list of included cluster IDs.

    • Blacklist: Specific hypervisors are excluded.

      • Exclude hosts: Comma-separated list of excluded hypervisors.

      • Exclude host parents: Comma-separated list of excluded cluster IDs.

    In the Filtering fields, specify the host name or UUID according to the hypervisor ID you selected. Follow these guidelines for 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.

  5. 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.

  6. Click Submit.

3.2. Creating a virt-who configuration by using Hammer CLI

You can create a virt-who configuration for VMware vSphere by using Hammer CLI.

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.

Prerequisites
  • 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.

Procedure
  • On Foreman server, enter the hammer virt-who-config create command:

    $ hammer virt-who-config create \
    --name My_virt-who_Configuration \
    --organizations "My_Organization" \
    --interval 720 \
    --filtering-mode none \
    --hypervisor-id hostname \
    --hypervisor-type esx \
    --hypervisor-server vcenter.example.com \
    --hypervisor-username virt_who_user \
    --hypervisor-password <password>
    --satellite-url foreman.example.com

In this command, use the following options:

  • In --filtering-mode, specify none for no filtering of hypervisors for virt-who queries. Specify whitelist or blacklist to include or exclude hypervisors for virt-who queries.

  • In --hypervisor-id, specify hostname, uuid, or hwuuid for the hypervisor ID format.

    • You can use uuid to avoid duplication if you rename a hypervisor.

    • You can use hwuuid for configurations that apply to a virtualization manager instead of an individual hypervisor.

      Note

      You cannot change hwuuid to another option after virt-who starts running because this might cause duplicate entries in Subscription Manager.

  • In --hypervisor-server, specify the FQDN or IP address of the vCenter Server.

  • In --hypervisor-username, specify the name of the virt-who user you created on the hypervisor.

  • Optionally, in the --proxy option, specify the proxy address and port, for example, --proxy 'http://proxy.example.com:3128'.

  • Optionally, in the --interval option, specify the virtual machine information reporting interval in minutes.

Example 2. VMware vSphere virt-who configuration
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.3. 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.

Procedure
  1. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  2. Click a virt-who configuration.

  3. Click the Deploy tab.

  4. Under Hammer command, click Copy to clipboard.

  5. Log in to Foreman server, paste the Hammer command into your terminal, and then run the command.

3.4. 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.

Procedure
  1. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  2. Click a virt-who configuration.

  3. Click the Deploy tab.

  4. Under Configuration script, click Download the script.

  5. Copy the script from Foreman server to Smart Proxy server:

    $ scp deploy_virt_who_config_1.sh root@smartproxy.example.com:
  6. Log in to Smart Proxy server and make the script executable:

    $ chmod +x deploy_virt_who_config_1.sh
  7. Run the script:

    $ sh deploy_virt_who_config_1.sh
  8. After the deployment is complete, delete the script:

    $ rm deploy_virt_who_config_1.sh

3.5. 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.

Prerequisites
Procedure
  1. Log in to the Enterprise Linux server.

  2. Add a TCP port for communication between virt-who and Foreman server to the runtime configuration:

    $ firewall-cmd --add-port="443/tcp"
  3. Add a TCP port for communication between virt-who and Foreman server to the permanent configuration:

    $ firewall-cmd --add-port="443/tcp" --permanent
  4. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  5. Click a virt-who configuration.

  6. Click the Deploy tab.

  7. Under Configuration script, click Download the script.

  8. Copy the script from Foreman server to the Enterprise Linux server:

    $ scp deploy_virt_who_config_1.sh root@server.example.com:
  9. Log in to the Enterprise Linux server and make the script executable:

    $ chmod +x deploy_virt_who_config_1.sh
  10. Run the script:

    $ sh deploy_virt_who_config_1.sh
  11. 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 by using the Foreman web UI

You can create a virt-who configuration for Nutanix AHV by using the Foreman web UI.

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.

Prerequisites
Procedure
  1. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  2. Click Create Config.

  3. 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.

  4. Optional: Filtering. Select one of the following options for querying hypervisors:

    • Unlimited (default): All hypervisors are queried.

    • Whitelist: Specific hypervisors are included.

      • Filter hosts: Comma-separated list of included hypervisors.

    • Blacklist: Specific hypervisors are excluded.

      • Exclude hosts: Comma-separated list of excluded hypervisors.

    In the Filtering fields, specify the host name or UUID according to the hypervisor ID you selected. Follow these guidelines for 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.

  5. 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.

  6. Select Prism Central or Prism Element from the Prism Flavor list.

  7. Optional: Enable AHV Debug: Enables AHV internal debugging. This option provides additional AHV information when you enable both debugging options.

  8. Click Submit.

4.2. Creating a virt-who configuration by using Hammer CLI

You can create a virt-who configuration for Nutanix AHV by using Hammer CLI.

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.

Prerequisites
Procedure
  • On Foreman server, enter the hammer virt-who-config create command:

    $ hammer virt-who-config create \
    --name My_virt-who_Configuration \
    --organizations "My_Organization" \
    --interval 720 \
    --filtering-mode none \
    --hypervisor-id hostname \
    --hypervisor-type ahv \
    --hypervisor-server prism.example.com \
    --hypervisor-username virt_who_user \
    --satellite-url foreman.example.com

In this command, use the following options:

  • In --filtering-mode, specify none for no filtering of hypervisors for virt-who queries. Specify whitelist or blacklist to include or exclude hypervisors for virt-who queries.

  • In --hypervisor-id, specify hostname, uuid, or hwuuid for the hypervisor ID format.

    • You can use uuid to avoid duplication if you rename a hypervisor.

    • You can use hwuuid for configurations that apply to a virtualization manager instead of an individual hypervisor.

      Note

      You cannot change hwuuid to another option after virt-who starts running because this might cause duplicate entries in Subscription Manager.

  • In --hypervisor-server, specify the FQDN or IP address of the hypervisor.

  • In --hypervisor-username, specify the name of the virt-who user you created on the hypervisor.

  • Optionally, in the --proxy option, specify the proxy address and port, for example, --proxy 'http://proxy.example.com:3128'.

  • Optionally, in the --interval option, specify the virtual machine information reporting interval in minutes.

Example 3. Nutanix AHV virt-who configuration
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.3. 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.

Procedure
  1. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  2. Click a virt-who configuration.

  3. Click the Deploy tab.

  4. Under Hammer command, click Copy to clipboard.

  5. Log in to Foreman server, paste the Hammer command into your terminal, and then run the command.

4.4. 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.

Procedure
  1. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  2. Click a virt-who configuration.

  3. Click the Deploy tab.

  4. Under Configuration script, click Download the script.

  5. Copy the script from Foreman server to Smart Proxy server:

    $ scp deploy_virt_who_config_1.sh root@smartproxy.example.com:
  6. Log in to Smart Proxy server and make the script executable:

    $ chmod +x deploy_virt_who_config_1.sh
  7. Run the script:

    $ sh deploy_virt_who_config_1.sh
  8. After the deployment is complete, delete the script:

    $ rm deploy_virt_who_config_1.sh

4.5. 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.

Prerequisites
Procedure
  1. Log in to the Enterprise Linux server.

  2. Add a TCP port for communication between virt-who and Foreman server to the runtime configuration:

    $ firewall-cmd --add-port="443/tcp"
  3. Add a TCP port for communication between virt-who and Foreman server to the permanent configuration:

    $ firewall-cmd --add-port="443/tcp" --permanent
  4. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  5. Click a virt-who configuration.

  6. Click the Deploy tab.

  7. Under Configuration script, click Download the script.

  8. Copy the script from Foreman server to the Enterprise Linux server:

    $ scp deploy_virt_who_config_1.sh root@server.example.com:
  9. Log in to the Enterprise Linux server and make the script executable:

    $ chmod +x deploy_virt_who_config_1.sh
  10. Run the script:

    $ sh deploy_virt_who_config_1.sh
  11. 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 by using the Foreman web UI

You can create a virt-who configuration for Microsoft Hyper-V by using the Foreman web UI.

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.

Prerequisites
  • 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.

Procedure
  1. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  2. Click Create Config.

  3. 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.

  4. Optional: Filtering. Select one of the following options for querying hypervisors:

    • Unlimited (default): All hypervisors are queried.

    • Whitelist: Specific hypervisors are included.

      • Filter hosts: Comma-separated list of included hypervisors.

    • Blacklist: Specific hypervisors are excluded.

      • Exclude hosts: Comma-separated list of excluded hypervisors.

    In the Filtering fields, specify the host name or UUID according to the hypervisor ID you selected. Follow these guidelines for 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.

  5. 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.

  6. Click Submit.

5.2. Creating a virt-who configuration by using Hammer CLI

You can create a virt-who configuration for Microsoft Hyper-V by using Hammer CLI.

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.

Prerequisites
  • 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.

Procedure
  • On Foreman server, enter the hammer virt-who-config create command:

    $ hammer virt-who-config create \
    --name My_virt-who_Configuration \
    --organizations "My_Organization" \
    --interval 720 \
    --filtering-mode none \
    --hypervisor-id hostname \
    --hypervisor-type hyperv \
    --hypervisor-server hypervisor.example.com \
    --hypervisor-username virt_who_user \
    --hypervisor-password <password>
    --satellite-url foreman.example.com

In this command, use the following options:

  • In --filtering-mode, specify none for no filtering of hypervisors for virt-who queries. Specify whitelist or blacklist to include or exclude hypervisors for virt-who queries.

  • In --hypervisor-id, specify hostname, uuid, or hwuuid for the hypervisor ID format.

    • You can use uuid to avoid duplication if you rename a hypervisor.

    • You can use hwuuid for configurations that apply to a virtualization manager instead of an individual hypervisor.

      Note

      You cannot change hwuuid to another option after virt-who starts running because this might cause duplicate entries in Subscription Manager.

  • In --hypervisor-server, specify the FQDN or IP address of the hypervisor.

  • In --hypervisor-username, specify the name of the virt-who user you created on the hypervisor.

  • Optionally, in the --proxy option, specify the proxy address and port, for example, --proxy 'http://proxy.example.com:3128'.

  • Optionally, in the --interval option, specify the virtual machine information reporting interval in minutes.

Example 4. Microsoft Hyper-V virt-who configuration
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.3. 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.

Procedure
  1. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  2. Click a virt-who configuration.

  3. Click the Deploy tab.

  4. Under Hammer command, click Copy to clipboard.

  5. Log in to Foreman server, paste the Hammer command into your terminal, and then run the command.

5.4. 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.

Procedure
  1. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  2. Click a virt-who configuration.

  3. Click the Deploy tab.

  4. Under Configuration script, click Download the script.

  5. Copy the script from Foreman server to Smart Proxy server:

    $ scp deploy_virt_who_config_1.sh root@smartproxy.example.com:
  6. Log in to Smart Proxy server and make the script executable:

    $ chmod +x deploy_virt_who_config_1.sh
  7. Run the script:

    $ sh deploy_virt_who_config_1.sh
  8. After the deployment is complete, delete the script:

    $ rm deploy_virt_who_config_1.sh

5.5. 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.

Prerequisites
Procedure
  1. Log in to the Enterprise Linux server.

  2. Add a TCP port for communication between virt-who and Foreman server to the runtime configuration:

    $ firewall-cmd --add-port="5985/tcp"
  3. Add a TCP port for communication between virt-who and Foreman server to the permanent configuration:

    $ firewall-cmd --add-port="5985/tcp" --permanent
  4. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  5. Click a virt-who configuration.

  6. Click the Deploy tab.

  7. Under Configuration script, click Download the script.

  8. Copy the script from Foreman server to the Enterprise Linux server:

    $ scp deploy_virt_who_config_1.sh root@server.example.com:
  9. Log in to the Enterprise Linux server and make the script executable:

    $ chmod +x deploy_virt_who_config_1.sh
  10. Run the script:

    $ sh deploy_virt_who_config_1.sh
  11. 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 by using the Foreman web UI

You can create a virt-who configuration for OpenStack by using the Foreman web UI.

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.

Prerequisites
  • 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.

Procedure
  1. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  2. Click Create Config.

  3. 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.

  4. Optional: Filtering. Select one of the following options for querying hypervisors:

    • Unlimited (default): All hypervisors are queried.

    • Whitelist: Specific hypervisors are included.

      • Filter hosts: Comma-separated list of included hypervisors.

    • Blacklist: Specific hypervisors are excluded.

      • Exclude hosts: Comma-separated list of excluded hypervisors.

    In the Filtering fields, specify the host name or UUID according to the hypervisor ID you selected. Follow these guidelines for 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.

  5. 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.

  6. Click Submit.

6.2. Creating a virt-who configuration by using Hammer CLI

You can create a virt-who configuration for OpenStack by using Hammer CLI.

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.

Prerequisites
  • 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.

Procedure
  • On Foreman server, enter the hammer virt-who-config create command:

    $ hammer virt-who-config create \
    --name My_virt-who_Configuration \
    --organizations "My_Organization" \
    --interval 720 \
    --filtering-mode none \
    --hypervisor-id hostname \
    --hypervisor-type libvirt \
    --hypervisor-server qemu:///system \
    --hypervisor-username virt_who_user \
    --satellite-url foreman.example.com

In this command, use the following options:

  • In --filtering-mode, specify none for no filtering of hypervisors for virt-who queries. Specify whitelist or blacklist to include or exclude hypervisors for virt-who queries.

  • In --hypervisor-id, specify hostname, uuid, or hwuuid for the hypervisor ID format.

    • You can use uuid to avoid duplication if you rename a hypervisor.

    • You can use hwuuid for configurations that apply to a virtualization manager instead of an individual hypervisor.

      Note

      You cannot change hwuuid to another option after virt-who starts running because this might cause duplicate entries in Subscription Manager.

  • In --hypervisor-server, specify the FQDN or IP address of the hypervisor.

  • In --hypervisor-username, specify the name of the virt-who user you created on the hypervisor.

  • Optionally, in the --proxy option, specify the proxy address and port, for example, --proxy 'http://proxy.example.com:3128'.

  • Optionally, in the --interval option, specify the virtual machine information reporting interval in minutes.

Example 5. OpenStack virt-who configuration
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.3. 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.

Prerequisites
  • You have registered the hypervisor to Foreman server.

Procedure
  1. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  2. Click a virt-who configuration.

  3. Click the Deploy tab.

  4. Under Configuration script, click Download the script.

  5. Copy the script from Foreman server to the hypervisor:

    $ scp deploy_virt_who_config_1.sh root@hypervisor.example.com:
  6. Log in to the hypervisor and make the script executable:

    $ chmod +x deploy_virt_who_config_1.sh
  7. Run the script:

    $ sh deploy_virt_who_config_1.sh
  8. 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 by using the Foreman web UI

You can create a virt-who configuration for KubeVirt by using the Foreman web UI.

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.

Prerequisites
Procedure
  1. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  2. Click Create Config.

  3. 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.

  4. Optional: Filtering. Select one of the following options for querying hypervisors:

    • Unlimited (default): All hypervisors are queried.

    • Whitelist: Specific hypervisors are included.

      • Filter hosts: Comma-separated list of included hypervisors.

    • Blacklist: Specific hypervisors are excluded.

      • Exclude hosts: Comma-separated list of excluded hypervisors.

    In the Filtering fields, specify the host name or UUID according to the hypervisor ID you selected. Follow these guidelines for 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.

  5. 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.

  6. Enter the kubeconfig file path.

  7. Click Submit.

7.2. Creating a virt-who configuration by using Hammer CLI

You can create a virt-who configuration for KubeVirt by using Hammer CLI.

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.

Prerequisites
Procedure
  • On Foreman server, enter the hammer virt-who-config create command:

    $ hammer virt-who-config create \
    --name My_virt-who_Configuration \
    --organizations "My_Organization" \
    --interval 720 \
    --filtering-mode none \
    --hypervisor-id hostname \
    --hypervisor-type cnv \
    --hypervisor-server hypervisor.example.com \
    --hypervisor-username virt_who_user \
    --satellite-url foreman.example.com

In this command, use the following options:

  • In --filtering-mode, specify none for no filtering of hypervisors for virt-who queries. Specify whitelist or blacklist to include or exclude hypervisors for virt-who queries.

  • In --hypervisor-id, specify hostname, uuid, or hwuuid for the hypervisor ID format.

    • You can use uuid to avoid duplication if you rename a hypervisor.

    • You can use hwuuid for configurations that apply to a virtualization manager instead of an individual hypervisor.

      Note

      You cannot change hwuuid to another option after virt-who starts running because this might cause duplicate entries in Subscription Manager.

  • In --hypervisor-server, specify the FQDN or IP address of the hypervisor.

  • In --hypervisor-username, specify the name of the virt-who user you created on the hypervisor.

  • Optionally, in the --proxy option, specify the proxy address and port, for example, --proxy 'http://proxy.example.com:3128'.

  • Optionally, in the --interval option, specify the virtual machine information reporting interval in minutes.

Example 6. KubeVirt virt-who configuration
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.3. 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.

Prerequisites
  • You have registered the hypervisor to Foreman server.

Procedure
  1. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  2. Click a virt-who configuration.

  3. Click the Deploy tab.

  4. Under Configuration script, click Download the script.

  5. Copy the script from Foreman server to the hypervisor:

    $ scp deploy_virt_who_config_1.sh root@hypervisor.example.com:
  6. Log in to the hypervisor and make the script executable:

    $ chmod +x deploy_virt_who_config_1.sh
  7. Run the script:

    $ sh deploy_virt_who_config_1.sh
  8. After the deployment is complete, delete the script:

    $ rm deploy_virt_who_config_1.sh

8. Editing a virt-who configuration by using Foreman web UI

You can edit a virt-who configuration by using Foreman web UI.

Procedure
  1. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  2. Select Edit in the Actions column of a virt-who configuration.

  3. Edit the fields and then click Submit.

  4. Deploy the modified virt-who configuration.

9. Editing a virt-who configuration by using Hammer CLI

You can edit a virt-who configuration by using Hammer CLI.

Procedure
  1. Update the virt-who configuration:

    $ hammer virt-who-config update \
    --name My_virt-who_Configuration \
    --new-name My_new_virt-who_Configuration \
    --interval 1440
  2. Deploy the modified virt-who configuration.

10. 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.

Procedure
  1. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  2. Select Delete from the Actions column of the virt-who configuration.

  3. On the hypervisor or virtualization manager, remove the configuration file by running the following command:

    $ rm /etc/virt-who.d/conf_name.conf

11. 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.

11.1. Checking virt-who status by using Foreman web UI

You can check the status of virt-who by using the Foreman web UI.

Procedure
  1. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  2. Check the Status column of each virt-who instance.

    The OK status indicates that virt-who is successfully connecting to Foreman server and reporting the virtual machines managed by each hypervisor.

11.2. Checking virt-who status by using Hammer CLI

You can check the status of virt-who by using Hammer CLI.

Procedure
  • List the status of all virt-who instances:

    $ hammer virt-who-config list

    The output includes the date and time when each virt-who instance reported to Foreman server.

11.3. Enabling RHSM debug logging by using Foreman web UI

You can enable Red Hat Subscription Manager (RHSM) debug logging for the /var/log/rhsm/rhsm.log file by using Foreman web UI.

After you resolve the problem, you must disable debug logging and redeploy the virt-who configuration.

Procedure
  1. In the Foreman web UI, navigate to Infrastructure > Virt-who Configurations.

  2. Select Edit in the Actions column of a virt-who configuration.

  3. Select Enable debugging output.

  4. Click Submit.

  5. Redeploy the virt-who configuration on the target host.

11.4. Enabling RHSM debug logging by using Hammer CLI

You can enable Red Hat Subscription Manager (RHSM) debug logging for the /var/log/rhsm/rhsm.log file by using Hammer CLI.

After you resolve the problem, you must disable debug logging and redeploy the virt-who configuration.

Procedure
  1. Set the logging level to debug:

    $ hammer virt-who-config update \
    --debug true
  2. Redeploy the virt-who configuration on the target host.

11.5. Virt-who troubleshooting methods

If you encounter the following problems when using virt-who in Foreman, you might resolve them by using the following solutions.

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
Identifying issues when using multiple virt-who configuration files

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
Identifying duplicate hypervisors

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.

Identifying duplicate virtual machines

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
Checking the number of hypervisors

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
Checking the number of virtual machines

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
Pre-release version Report issue