You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Bug Reference

https://issues.apache.org/jira/browse/CLOUDSTACK-6256

Branch

4.4

Introduction

An event in cloudstack can be change in state (like create, edit, delete etc) of the resources, an action performed by the user (like login, logout etc ) or policy based events aka alerts. These events hold success or failure details of an event. Events for asynchronous jobs log when a job is scheduled, when it starts, and when it completes. While events for long running synchronous jobs log when it starts and when it completes.

Purpose

Currently the events logged in CloudStack doesn't give detailed information about the event that has occurred. The information provided in each event shown on the cloudstack ui doesn't provide specifics, particularly in case of errors. For example, the message shown on the cloudstack ui is just "Error while starting Vm. Vm Id: <id>" in case of failure to start a vm , which doesn't help much. Hence, the events should be enhanced to include more information to be descriptive enough.

Proposal

I would like to propose some changes to enhance the events to be more informative. Like:

  1. Instead of just showing resource database id in the event details it should display resource UUID. Since all the cloudstack apis take input as resource uuid it would be helpful to see the same on the ui as well.
  2. Enhance the events and listEvents API to include the resource UUID so that it can be queried by the resource UUID as well.
  3. Currently, the event description messages are specified in the *Cmd.java file instead, all of them should be externalize to a resource file. This would be helpful even for internationalization.
  4. Provide more detailed messages in case of error events. Messages such as "Error while starting VM" are generic to take any action.

Design description and changes

Currently all the cloudstack events are persisted into the cloud database in the event and event_view table.

 

mysql> desc event_view;                                                     mysql> desc event;
+--------------+---------------------+------+-----+-----------+-------+     +-------------+---------------------+------+-----+-----------+----------------+
| Field        | Type                | Null | Key | Default   | Extra |     | Field       | Type                | Null | Key | Default   | Extra          |
+--------------+---------------------+------+-----+-----------+-------+     +-------------+---------------------+------+-----+-----------+----------------+
| id           | bigint(20) unsigned | NO   |     | 0         |       |     | id          | bigint(20) unsigned | NO   | PRI | NULL      | auto_increment |
| uuid         | varchar(40)         | YES  |     | NULL      |       |     | uuid        | varchar(40)         | YES  | UNI | NULL      |                |
| type         | varchar(32)         | NO   |     | NULL      |       |     | type        | varchar(32)         | NO   | MUL | NULL      |                |
| state        | varchar(32)         | NO   |     | Completed |       |     | state       | varchar(32)         | NO   |     | Completed |                |
| description  | varchar(1024)       | NO   |     | NULL      |       |     | description | varchar(1024)       | NO   |     | NULL      |                |
| created      | datetime            | NO   |     | NULL      |       |     | user_id     | bigint(20) unsigned | NO   | MUL | NULL      |                |
| level        | varchar(16)         | NO   |     | NULL      |       |     | account_id  | bigint(20) unsigned | NO   | MUL | NULL      |                |
| parameters   | varchar(1024)       | YES  |     | NULL      |       |     | domain_id   | bigint(20) unsigned | NO   |     | NULL      |                |
| start_id     | bigint(20) unsigned | NO   |     | 0         |       |     | created     | datetime            | NO   | MUL | NULL      |                |
| start_uuid   | varchar(40)         | YES  |     | NULL      |       |     | level       | varchar(16)         | NO   | MUL | NULL      |                |
| user_id      | bigint(20) unsigned | NO   |     | NULL      |       |     | start_id    | bigint(20) unsigned | NO   |     | 0         |                |
| archived     | tinyint(1) unsigned | NO   |     | 0         |       |     | parameters  | varchar(1024)       | YES  |     | NULL      |                |
| user_name    | varchar(255)        | NO   |     | NULL      |       |     | archived    | tinyint(1) unsigned | NO   |     | 0         |                |
| account_id   | bigint(20) unsigned | NO   |     | 0         |       |     +-------------+---------------------+------+-----+-----------+----------------+
| account_uuid | varchar(40)         | YES  |     | NULL      |       |
| account_name | varchar(100)        | YES  |     | NULL      |       |
| account_type | int(1) unsigned     | NO   |     | NULL      |       |
| domain_id    | bigint(20) unsigned | NO   |     | 0         |       |
| domain_uuid  | varchar(40)         | YES  |     | NULL      |       |
| domain_name  | varchar(255)        | YES  |     | NULL      |       |
| domain_path  | varchar(255)        | NO   |     | NULL      |       |
| project_id   | bigint(20) unsigned | YES  |     | 0         |       |
| project_uuid | varchar(40)         | YES  |     | NULL      |       |
| project_name | varchar(255)        | YES  |     | NULL      |       |
+--------------+---------------------+------+-----+-----------+-------+

 

In order to enhance the events logged in cloudstack

 

  1. Add a new field error_message in the event_view table 

    +---------------+---------------------+------+-----+-----------+-------+
    | Field         | Type                | Null | Key | Default   | Extra |
    +---------------+---------------------+------+-----+-----------+-------+
    | error_message | varchar(1024)       | YES  |     | NULL      |       |
    +---------------+---------------------+------+-----+-----------+-------+
  2. Use the existing parameters field (in the event and event_view table) to hold the event parameters. For example, the parameters required for deployVirtualMachine command like the zoneId, serviceOfferingId, templateId would be stored in the parameter field.

 

Introduce resource UUID in event description

All cloudstack async apis specifies event description which specifies the database id of the resource. In order to change the database id to resource UUID there would not be any design level changes. Currently, the resource uuid passed as required parameter are translated into internal id.

Details

Introduce resource UUID

A working patch file (for master) for one of the api DeleteDomainCmd is attached here.

As per current implementation event descriptions would be changed for all the below mentioned commands

DeleteDomainCmd.java
DeleteAccountCmd.java
DisableAccountCmd.java
MarkDefaultZoneForAccountCmd.java
StartSystemVMCmd.java
RebootSystemVmCmd.java
ScaleSystemVMCmd.java
DestroySystemVmCmd.java
MigrateSystemVMCmd.java
StopSystemVmCmd.java
StartRouterCmd.java
StopRouterCmd.java
CreateVirtualRouterElementCmd.java
RebootRouterCmd.java
DestroyRouterCmd.java
ConfigureVirtualRouterElementCmd.java
CancelMaintenanceCmd.java
PrepareForMaintenanceCmd.java
ReleaseHostReservationCmd.java
ReconnectHostCmd.java
DeletePrivateGatewayCmd.java
UpdateVPCOfferingCmd.java
DeleteVPCOfferingCmd.java
CreateVPCOfferingCmd.java
CreatePrivateGatewayCmd.java
CleanVMReservationsCmd.java
UploadCustomCertificateCmd.java
MigrateVirtualMachineWithVolumeCmd.java
MigrateVMCmd.java
ExpungeVMCmd.java
UpdateStorageNetworkIpRangeCmd.java
UpdatePhysicalNetworkCmd.java
AddNetworkServiceProviderCmd.java
DeleteNetworkServiceProviderCmd.java
DeletePhysicalNetworkCmd.java
DeleteStorageNetworkIpRangeCmd.java
UpdateNetworkServiceProviderCmd.java
ReleaseDedicatedGuestVlanRangeCmd.java
CreatePhysicalNetworkCmd.java
CreateStorageNetworkIpRangeCmd.java
StopInternalLBVMCmd.java
ConfigureInternalLoadBalancerElementCmd.java
CreateInternalLoadBalancerElementCmd.java
StartInternalLBVMCmd.java
DisableUserCmd.java
CancelPrimaryStorageMaintenanceCmd.java
PreparePrimaryStorageForMaintenanceCmd.java
DeletePortableIpRangeCmd.java
CreatePortableIpRangeCmd.java
AddTrafficTypeCmd.java
UpdateTrafficTypeCmd.java
DeleteTrafficTypeCmd.java
DeleteCounterCmd.java
CreateCounterCmd.java
GenerateAlertCmd.java
ExtractVolumeCmd.java
UploadVolumeCmd.java
ResizeVolumeCmd.java
UpdateVolumeCmd.java
CreateVolumeCmd.java
DetachVolumeCmd.java
AddResourceDetailCmd.java
MigrateVolumeCmd.java
AttachVolumeCmd.java
RemoveResourceDetailCmd.java
DeleteAccountFromProjectCmd.java
AddAccountToProjectCmd.java
DeleteTemplateCmd.java
ExtractTemplateCmd.
CopyTemplateCmd.java
CreateTemplateCmd.java
DeleteIpForwardingRuleCmd.java
CreateIpForwardingRuleCmd.java
DisableStaticNatCmd.java
UpdatePortForwardingRuleCmd.java
CreateFirewallRuleCmd.java
DeleteEgressFirewallRuleCmd.java
DeletePortForwardingRuleCmd.java
CreateEgressFirewallRuleCmd.java
DeleteFirewallRuleCmd.java
CreatePortForwardingRuleCmd.java
ExtractIsoCmd.java
DeleteIsoCmd.java
DetachIsoCmd.java
AttachIsoCmd.java
DeleteVPCCmd.java
CreateVPCCmd.java
CreateStaticRouteCmd.java
DeleteStaticRouteCmd.java
UpdateVPCCmd.java
RestartVPCCmd.java
DeleteVMSnapshotCmd.java
RevertToVMSnapshotCmd.java
CreateVMSnapshotCmd.java
RevertSnapshotCmd.java
DeleteSnapshotCmd.java
CreateSnapshotCmd.java
RemoveCertFromLoadBalancerCmd.java
DeleteLBStickinessPolicyCmd.java
RemoveFromLoadBalancerRuleCmd.java
DeleteLoadBalancerRuleCmd.java
CreateLoadBalancerRuleCmd.java
DeleteLBHealthCheckPolicyCmd.java
UpdateLoadBalancerRuleCmd.java
CreateLBHealthCheckPolicyCmd.java
DeleteApplicationLoadBalancerCmd.java
AssignToLoadBalancerRuleCmd.java
AssignCertToLoadBalancerCmd.java
CreateLBStickinessPolicyCmd.java
CreateApplicationLoadBalancerCmd.java
UpdateDefaultNicForVMCmd.java
DestroyVMCmd.java
DeployVMCmd.java
StartVMCmd.java
RemoveIpFromVmNicCmd.java
StopVMCmd.java
AddIpToVmNicCmd.java
RebootVMCmd.java
RemoveNicFromVMCmd.java
RestoreVMCmd.java
ResetVMPasswordCmd.java
AddNicToVMCmd.java
ScaleVMCmd.java
ResetVMSSHKeyCmd.java
DeleteNetworkCmd.java
DeleteNetworkACLCmd.java
RestartNetworkCmd.java
CreateNetworkACLListCmd.java
ReplaceNetworkACLListCmd.java
CreateNetworkACLCmd.java
UpdateNetworkCmd.java
DeleteNetworkACLListCmd.java
UpdateNetworkACLItemCmd.java
DeleteAffinityGroupCmd.java
UpdateVMAffinityGroupCmd.java
CreateAffinityGroupCmd.java
AssociateIPAddrCmd.java
DisassociateIPAddrCmd.java
AssignToGlobalLoadBalancerRuleCmd.java
CreateGlobalLoadBalancerRuleCmd.java
DeleteGlobalLoadBalancerRuleCmd.java
UpdateGlobalLoadBalancerRuleCmd.java
RemoveFromGlobalLoadBalancerRuleCmd.java
DeleteTagsCmd.java
CreateTagsCmd.java
SuspendProjectCmd.java
DeleteProjectCmd.java
UpdateProjectCmd.java
DeleteProjectInvitationCmd.java
CreateProjectCmd.java
UpdateProjectInvitationCmd.java
ActivateProjectCmd.java
CreateRemoteAccessVpnCmd.java
DeleteVpnConnectionCmd.java
DeleteRemoteAccessVpnCmd.java
DeleteVpnCustomerGatewayCmd.java
UpdateVpnCustomerGatewayCmd.java
RemoveVpnUserCmd.java
CreateVpnConnectionCmd.java
CreateVpnGatewayCmd.java
CreateVpnCustomerGatewayCmd.java
ResetVpnConnectionCmd.java
DeleteVpnGatewayCmd.java
AddVpnUserCmd.java
AuthorizeSecurityGroupIngressCmd.java
AuthorizeSecurityGroupEgressCmd.java
RevokeSecurityGroupIngressCmd.java
RevokeSecurityGroupEgressCmd.java
CreateAutoScaleVmGroupCmd.java
CreateConditionCmd.java
DisableAutoScaleVmGroupCmd.java
UpdateAutoScalePolicyCmd.java
UpdateAutoScaleVmGroupCmd.java
CreateAutoScalePolicyCmd.java
EnableAutoScaleVmGroupCmd.java
DeleteConditionCmd.java
UpdateAutoScaleVmProfileCmd.java
DeleteAutoScaleVmProfileCmd.java
DeleteAutoScaleVmGroupCmd.java
CreateAutoScaleVmProfileCmd.java
DeleteAutoScalePolicyCmd.java
EnableCiscoNexusVSMCmd.java
DeleteCiscoNexusVSMCmd.java
DisableCiscoNexusVSMCmd.java
DisassociateUcsProfileCmd.java
AssociateUcsProfileToBladeCmd.java
InstantiateUcsTemplateAndAssociateToBladeCmd.java
AddBaremetalDhcpCmd.java
AddBaremetalPxeCmd.java
ReleaseDedicatedClusterCmd.java
DedicateClusterCmd.java
ReleaseDedicatedZoneCmd.java
ReleaseDedicatedHostCmd.java
DedicateHostCmd.java
DedicatePodCmd.java
DedicateZoneCmd.java
ReleaseDedicatedPodCmd.java
ConfigureSrxFirewallCmd.java
AddSrxFirewallCmd.java
DeleteSrxFirewallCmd.java
DeletePaloAltoFirewallCmd.java
ConfigurePaloAltoFirewallCmd.java
AddPaloAltoFirewallCmd.java
DeleteBigSwitchVnsDeviceCmd.java
AddBigSwitchVnsDeviceCmd.java
DeleteNiciraNvpDeviceCmd.java
AddNiciraNvpDeviceCmd.java
DeleteNetscalerLoadBalancerCmd.java
AddNetscalerLoadBalancerCmd.java
ConfigureNetscalerLoadBalancerCmd.java
commandCreateServiceInstanceCmd.java
DeleteF5LoadBalancerCmd.java
AddF5LoadBalancerCmd.java
ConfigureF5LoadBalancerCmd.java
  • No labels