Radek Nováček
/etc/sysconfig/virt-who
# General options
VIRTWHO_DEBUG=1
VIRTWHO_INTERVAL=60
# Following is deprecated
VIRTWHO_SATELLITE6=1
VIRTWHO_SATELLITE5=0
VIRTWHO_ESX=1
VIRTWHO_ESX_SERVER=esx.example.com
VIRTWHO_ESX_USERNAME=admin
VIRTWHO_ESX_PASSWORD=password
VIRTWHO_ESX_OWNER=owner
VIRTWHO_ESX_ENV=env
/etc/virt-who.conf
/etc/virt-who.d/*
[esx-name]
type=esx
server=esx.example.com
username=admin
password=password
#encrypted_password=a4393c84f76b4c80bf4246f2129dec29
hypervisor_id=uuid # or hostname or hwuuid
filter_hosts= # what hypervisors should be reported
exclude_hosts= # what hypervisors should NOT be reported
# For SAM and Satellite 6
owner=owner
env=env
rhsm_XXX # override XXX option in /etc/rhsm/rhsm.conf
# can be used on unregistered system
# For Satellite 5
sat_server
sat_username
sat_password
#sat_encrypted_password
{
"hypervisors": [
{
"uuid": "9705df9f-76d4-4343-bf10-229e8692ecee",
"guests": [
{
"guestId": "564dae86-b20b-0214-0203-dc50d3be0ec2",
"state": 5,
"attributes": {
"active": 0,
"virtWhoType": "esx"
}
},
...
],
"facts": {
"hypervisor.type": "VMware ESXi",
"cpu.cpu_socket(s)": "2",
"hypervisor.version": "5.5.0"
},
"name": "localhost"
}
]
}
-d
on command-lineVIRTWHO_DEBUG=1
in /etc/sysconfig/virt-who
/var/log/rhsm/rhsm.log
main.py
- entry point, daemonize, executeparser.py
- parse cli optionsexecutor.py
- main loopvirt/virt.py
- hypervisor and vm abstrations, base for virt backendsvirt/[backend]/[backend].py
- backend implementation, derives from Virt
classmanager/manager.py
- base for managersmanager/subscriptionmanager/subscriptionmanager.py
- communication with candlepin (SAM, Sat6)manager/satellite/satellite.py
- communication with Satellite 5using python-rhsm package
ping()
for connection checkingupdateConsumer()
for local hypervisorshypervisorCheckIn()
for remote hypervisorsgetJob()
get job status if jobs are supported (needs Candlepin 2.0)/var/lib/virt-who/hypervisor-systemid-*
using XMLRPC, two API endpoints
auth.login
channel.software.getDetails
channel.software.create
distchannel.setMapForOrg
registration.new_system_user_pass
registration.refresh_hw_profile
registration.virt_notify