The KVMGuest agent enables Cluster Server (VCS) to monitor a KVM guest - that is, a virtual machine in the KVM environment or the Red Hat Enterprise Virtualization (RHEV) environment. The agent performs tasks such as bringing virtual machines online and taking them offline. The KVMGuest agent operates in both KVM and RHEV environments. This topic describes its behavior in the RHEV environment.
For details on the KVMGuest agent behavior in open source KVM environment or RHEV environment, see the Cluster Server Bundled Agents Reference Guide.
The KVMGuest agent uses virsh commands to manage virtual machines in the KVM environment and Representational State Transfer (REST) APIs to manage virtual machines in RHEV environment by using the REST APIs to determine the state of the virtual machine. The agent determines the resource state, on the basis of the virtual machine state. REST design architecture focuses on resources and their representations for some specific service. REST APIs help software developers and administrators integrate the functionality of the RHEV environment with custom scripts or with external applications which access the API by means of HTTP.
Prerequisites for administering virtual machines in a RHEV environment by using REST APIs:
A networked installation of Red Hat Enterprise Virtualization Manager, which includes the REST API
A client or programming library that initiates and receives HTTP requests from the REST API
The following table lists various states of a virtual machine in RHEV environment and the corresponding VCS resource state:
Table:
Table: KVMGuest agent functions
The KVMGuest agent recognizes the following resource states:
Table:
Resource state |
Description |
---|---|
ONLINE |
Indicates that the guest virtual machine is running. |
OFFLINE |
Indicates that the guest virtual machine has stopped. |
FAULTED |
Indicates that the guest virtual machine has failed to start or has unexpectedly stopped. |
UNKNOWN |
Indicates that a problem exists with the configuration or with the ability to monitor the resource. |
INTENTIONAL OFFLINE |
Indicates that the virtual machine has either migrated to another physical host or the administrator intentionally suspended it. |
The Cluster Server agent for managing virtual machines in a KVM or RHEV environment, is represented by the KVMGuest resource type definition:
type KVMGuest ( static int IntentionalOffline = 1 static boolean AEPTimeout = 1 static int MigrateTimeout = 300 static int MigrateWaitLimit = 2 static keylist SupportedActions = { "guestmigrated", "vmconfigsync", "DevScan" } static keylist SupportedOperations = { "migrate"} static keylist RegList = { "GuestName", "DelayAfterGuestOnline", "DelayAfterGuestOffline", "RHEVMInfo", "DROpts" } static str ArgList[] = { GuestName, DelayAfterGuestOnline, DelayAfterGuestOffline, SyncDir, GuestConfigFilePath, CEInfo, RHEVMInfo, ResyncVMCfg, DROpts } str CEInfo{} = { Enabled=0, CESystem=NONE, FaultOnHBLoss=1 } str RHEVMInfo{} = { Enabled=0, URL=NONE, User=NONE, Password=NONE, Cluster=NONE, UseManualRHEVMFencing=0 } str GuestName int DelayAfterGuestOnline = 5 int DelayAfterGuestOffline = 30 str SyncDir str GuestConfigFilePath boolean ResyncVMCfg = 0 str DROpts{} = { ConfigureNetwork=0, IPAddress=NONE, Netmask=NONE, Gateway=NONE, DNSServers=NONE, DNSSearchPath=NONE, Device=NONE } )
The RHEVMInfo attribute enables the KVMGuest attribute configuration to support the Red Hat Enterprise Virtualization environment. RHEVMInfo specifies the following information about the RHEV environment:
Attribute value |
Description |
---|---|
Enabled |
Specifies whether the virtualization environment is a KVM environment or a Red Hat Enterprise Virtualization (RHEV) environment. 0 indicates the KVM environment. 1 indicates the RHEV environment. The default value is 0. |
URL |
Specifies the RHEV-M URL, that the KVMGuest agent can use for REST API communication. The API can only communicate with the secure port (SSL). For example: https://rhevm-server.example.com:443 |
User |
Specifies the RHEV-M user name that the agent must use for REST API communication. For example: admin@internal rhevadmin@example.com |
Password |
Specifies the encrypted password associated with the RHEVM user profile. The password should be encrypted using "vcsencrypt" command. To generate the encrypted password, run the following command: # /opt/VRTSvcs/bin/vcsencrypt -agent plain_text_password |
Cluster |
Specifies the name of the RHEV-M cluster of which the VCS host is a member. |
UseManualRHEVMFencing |
Specifies if the use of manual RHEV-M fencing is enabled in the event that the physical host on which virtual machine is running crashes. 0 indicates that manual RHEV-M fencing is disabled. 1 indicates that manual RHEV-M fencing is enabled. The default value is 0. |
The DROpts attribute enables the virtual machine for disaster recovery. The attribute contains site-specific network parameters for the virtual machine. The value of this attribute consists of the following keys that define the disaster recovery options for the virtual machine:
Attribute keys |
Description |
---|---|
DNSSearchPath |
The domain search path used by the virtual machine in this site. The value of this key must contain a list of DNS domain names that are used for the DNS lookup of a hostname in case the domain name of the hostname is not specified. Use spaces to separate the domain names. |
DNSServers |
The list of DNS servers used by the virtual machine in this site. The value of this key must contain a list of IP addresses of DNS servers that are used for the DNS lookup of a hostname. Use spaces to separate the IP addresses. |
Gateway |
The default gateway used by the virtual machine in this site. |
Device |
The Network Interface Card (NIC) that is dedicated to the exclusive IP address of the virtual machine in this site. If this key is not specified, the agent automatically selects the first dedicated NIC for the assignment of the IP address, if specified. Example: eth0. |
IPAddress |
The IP address to be assigned to the virtual machine in this site after a cross-site failover. |
Netmask |
The netmask to be used by the virtual machine in this site after a cross-site failover. |
ConfigureNetwork |
The DROpts attribute value is applied to the virtual machine only if this key is set to 1. Type and dimension: string-association. |