Skip to content

Conversation

@erikbocks
Copy link
Collaborator

Description

Currently, API parameters that have UUID as their type either accept the resource's UUID, or their internal ID directly. If the resource UUID was provided, a workflow responsible for processing the parameters of the APIs automatically translates it to the resource's internal ID before it reaches the API level. However, some APIs events descriptions are created after the translation process. If the command wishes to present which resource is being interacted with, the translation process causes API events descriptions to expose the resource's internal ID to the final user.

As a workaround, it is possible to use the UuidMgr.getUuid(Class<T> entityType, Long customId) method to get the resource's UUID. Even though this method can be used, it is very verbose and makes an additional call to the database. Thus, in order to solve this issue, the getResourceUuid(String parameterName) method was created.

This method belongs to the BaseCmd class, allowing all current and future API classes to inherit it. To store the resources UUIDs, the apiResourcesUuids HashMap was added to the CallContext class. This map is populated during the parameter processing, that occurs at the ParamProcessWorker#translateUuidToInternalId(final String uuid, final Parameter annotation) method, leveraging the UUID translation process to eliminate the additional database call. For each UUID type parameter sent, the map is populated with the parameter's name as the map key, and the resource's UUID as its value. If the provided key is not found in the map, or the value found is not a UUID, the method returns a null value.

This PR also refactors events descriptions, aiming to enhance them to be more descriptive or only to implement the new getResourceUuid() method. The method calling was standardized by using the ApiConstants attributes as the parameterName value.

Fixes: #11859

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Screenshots (if appropriate):

How Has This Been Tested?

After applying the updated packages to my local environment, I called the disable account API, informing the id parameter as the account's UUID, and validated that the created event contained the resource UUID instead of the database ID. The same process was repeated informing the resource's database ID as the parameter value, and the correct behavior was observed. By using a debugger, I also validated that the parameter processing flow as executing the correct validations and storing the values correctly in the HashMap.

The codebase tests were also successfully executed.

@github-actions
Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@erik-bock-silva erik-bock-silva force-pushed the create-new-method-for-resource-uuid-obtention branch from 3e77924 to 6f16482 Compare January 22, 2026 12:00
@erikbocks erikbocks added this to the 4.23.0 milestone Jan 22, 2026
@bernardodemarco
Copy link
Member

@erikbocks, it seems that there are some checkstyle errors:

Error:  Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.1.0:check (cloudstack-checkstyle) on project cloud-api: Failed during checkstyle execution: There is 1 error reported by Checkstyle 8.18 with cloud-style.xml ruleset. -> [Help 1]

@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 10.00000% with 414 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.85%. Comparing base (420bf6d) to head (0c39212).
⚠️ Report is 123 commits behind head on main.

Files with missing lines Patch % Lines
...ack/api/command/user/template/CopyTemplateCmd.java 0.00% 8 Missing ⚠️
...stack/api/command/user/volume/CreateVolumeCmd.java 0.00% 7 Missing ⚠️
.../cloudstack/api/command/admin/vm/MigrateVMCmd.java 0.00% 6 Missing ⚠️
...stack/api/command/user/volume/DetachVolumeCmd.java 0.00% 6 Missing ⚠️
...k/api/command/admin/account/DisableAccountCmd.java 0.00% 5 Missing ⚠️
...command/user/network/ReplaceNetworkACLListCmd.java 0.00% 5 Missing ⚠️
...stack/api/command/user/volume/ResizeVolumeCmd.java 0.00% 5 Missing ⚠️
...i/command/user/account/AddAccountToProjectCmd.java 0.00% 4 Missing ⚠️
...cloudstack/api/command/user/iso/ExtractIsoCmd.java 0.00% 4 Missing ⚠️
.../api/command/user/template/ExtractTemplateCmd.java 0.00% 4 Missing ⚠️
... and 246 more
Additional details and impacted files
@@            Coverage Diff            @@
##               main   #12502   +/-   ##
=========================================
  Coverage     17.85%   17.85%           
- Complexity    15993    15997    +4     
=========================================
  Files          5929     5930    +1     
  Lines        531155   531253   +98     
  Branches      64921    64938   +17     
=========================================
+ Hits          94830    94863   +33     
- Misses       425709   425770   +61     
- Partials      10616    10620    +4     
Flag Coverage Δ
uitests 3.58% <ø> (-0.01%) ⬇️
unittests 18.95% <10.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DaanHoogland
Copy link
Contributor

Thanks for the hard work and description. It seems like a good solution. I will try to get through all the small changes.

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small remarks, clgtm generally, needs a lot of trivial testing.

@bernardodemarco bernardodemarco self-requested a review January 26, 2026 12:36
@erikbocks
Copy link
Collaborator Author

Hello, @DaanHoogland and @sureshanaparti

Firstly, thank you for the reviews and for the suggestions. Regarding some the questions brought by @sureshanaparti:

What event description is logged for create/add calls (UUID might not exist)?

This behavior will depend on how the API handles its events' creation. The majority of APIs uses the ActionEvent annotation, which stores information as the description and the event type. This information is gathered by some intercept... methods present at the ActionEventInterception class. These methods gather the information defined at the method's annotation, and publish the event. Some APIs, as the asynchronous ones, have some intermediate events informing whether the operation was Scheduled or Started. The description of the Scheduled events are based on the getEventDescription() method, which is the main focus of this PR. Events with other states, as Completed and Created ones, use the CallContext.eventDetails attribute. This attribute is set during the API processing, and is used together with the ActionEvent description.

The majority of APIs for creation or addition of resources does not have any events informing the resource's UUID; thus, the change in this PR does not affect them. However, there are some APIs that have an event description that display a UUID. These APIs are the ones that inherit from the BaseAsyncCreateCmd class, and thus, have the create() method, which is a method that is executed prior to the BaseCmd's execute(). This means that, when the API processing flow reaches the event's description obtention step, the resource was already created.

can add to Map here, instead of querying db again.

The reason for not inserting the UUID obtention logic there is because these lines are only executed when the parameter has the @ACL annotation. In order to address both parameters that has these annotation, as the ones that does not, the UUID obtention logic was added to the translateUuidToInternalId() method. This method is executed inside the setFieldValue() method, which is executed at line 210, prior to the referenced snippets (lines 264 and 287). In addition to that, is important to note that the second snippet refers to the processing of a UUID list parameter. As changing the processing of List type parameters would require changing the current logic, in order to allow the storing of the resources' UUIDs, I choose not to address these cases in this PR.


@DaanHoogland, after analysing @sureshanaparti's reviews, I noticed that some events details set in the CallContext class were not being addressed. Therefore, I went through these occurrences and made changes to them, in order to use the new UUID obtention method. Could you please review the files again?

@DaanHoogland
Copy link
Contributor

@erikbocks , boring review, but hard work from your side. Thanks for that. It still looks good . It will need testing adn also I am a bit worried about completeness. Can you give your thoughts on

  1. what is the risk in case we (you) forgot some locations to change?
  2. how can we assess if we are complete?
    I’ll do some testing.

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 16633

@RosiKyu
Copy link
Collaborator

RosiKyu commented Jan 29, 2026

@blueorangutan package

@blueorangutan
Copy link

@RosiKyu a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@RosiKyu RosiKyu self-assigned this Jan 29, 2026
@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16635

Copy link
Collaborator

@RosiKyu RosiKyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test Summary

An issue was found: TC16 - Disable Account

Issue: Event description displays internal numeric Domain ID instead of UUID.

Actual event description:

Disabling account. Account Name: testuser, Domain Id:2

Expected event description:

Disabling Account. Account Name: testuser, Domain ID: 35fd4e71-f583-4020-b9eb-b39ada1f3754

Overall

  • Functional impact: None - system operates correctly regardless
  • UX impact: Inconsistency - some events show UUIDs, others show internal IDs
  • Security consideration: Internal IDs can leak system information (e.g., Domain Id:2 reveals only 2 domains exist)
  • Troubleshooting impact: Users cannot easily correlate event descriptions with API responses

The PR achieves its objective for the vast majority of commands tested. The single failure in Disable Account appears to be an oversight.

The failure mode is graceful - missed locations simply retain old behavior, nothing breaks.

Test Cases Executed

# Test Case Event Type Result
1 Deploy VM VM.CREATE PASS
2 Stop VM VM.STOP PASS
3 Start VM VM.START PASS
4 Reboot VM VM.REBOOT PASS
5 Destroy VM VM.DESTROY PASS
6 Create Volume VOLUME.CREATE PASS
7 Attach Volume VOLUME.ATTACH PASS
8 Detach Volume VOLUME.DETACH PASS
9 Create Snapshot SNAPSHOT.CREATE PASS
10 Delete Snapshot SNAPSHOT.DELETE PASS
11 Restart Network NETWORK.RESTART PASS
12 Create Firewall Rule FIREWALL.OPEN PASS
13 Host Prepare Maintenance MAINT.PREPARE PASS
14 Enable HA for Host HA.RESOURCE.ENABLE PASS
15 Create Domain DOMAIN.CREATE PASS
16 Disable Account ACCOUNT.DISABLE FAIL
17 Reboot SSVM SSVM.REBOOT PASS
18 Reboot Router ROUTER.REBOOT PASS
19 Copy Template TEMPLATE.COPY PASS
20 Create Project PROJECT.CREATE PASS

Detailed Test Report

TC1: Deploy Virtual Machine - Event Description UUID Verification

Objective:
Verify that VM.CREATE event descriptions display resource UUIDs instead of internal database IDs after PR #12502 implementation.

Test Steps:

  1. Deploy a new virtual machine using CloudMonkey CLI with specified service offering, template, and zone UUIDs
  2. Query VM.CREATE events to examine the event descriptions
  3. Verify that resource identifiers in event descriptions are UUIDs (36-character format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) and not internal numeric IDs

Expected Result:
Event descriptions should contain UUIDs (e.g., 8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26) instead of internal numeric database IDs (e.g., 3).

Actual Result:
PASS - All VM.CREATE event descriptions correctly display the VM UUID (8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26) instead of internal numeric IDs.

Test Evidence:

(localcloud) 🐱 > deploy virtualmachine serviceofferingid=0707c467-3872-4cd6-a98a-7ed99fc91dc8 templateid=585c17ba-fdba-11f0-948c-1e00f3000407 zoneid=f7467ddc-d2ae-490f-af3e-5e632f580381 name=test-pr12502-vm1
{
  "virtualmachine": {
    "id": "8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
    "name": "test-pr12502-vm1",
    "state": "Running",
    "templateid": "585c17ba-fdba-11f0-948c-1e00f3000407",
    "serviceofferingid": "0707c467-3872-4cd6-a98a-7ed99fc91dc8",
    "zoneid": "f7467ddc-d2ae-490f-af3e-5e632f580381"
    ...
  }
}

(localcloud) 🐱 > list events type=VM.CREATE
{
  "count": 3,
  "event": [
    {
      "created": "2026-01-30T10:34:38+0000",
      "description": "Starting Instance with ID: 8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourceid": "8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourcename": "test-pr12502-vm1",
      "state": "Scheduled",
      "type": "VM.CREATE"
    },
    {
      "created": "2026-01-30T10:34:38+0000",
      "description": "Deploying Vm. Instance ID: 8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourceid": "8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourcename": "test-pr12502-vm1",
      "state": "Started",
      "type": "VM.CREATE"
    },
    {
      "created": "2026-01-30T10:35:56+0000",
      "description": "Successfully completed deploying Vm. Instance ID: 8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourceid": "8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourcename": "test-pr12502-vm1",
      "state": "Completed",
      "type": "VM.CREATE"
    }
  ]
}

TC2: Stop Virtual Machine - Event Description UUID Verification

Objective:
Verify that VM.STOP event descriptions display resource UUIDs instead of internal database IDs after PR #12502 implementation.

Test Steps:

  1. Stop the running virtual machine using its UUID
  2. Query VM.STOP events to examine the event descriptions
  3. Verify that resource identifiers in event descriptions are UUIDs (36-character format) and not internal numeric IDs

Expected Result:
Event descriptions should contain UUIDs (e.g., 8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26) instead of internal numeric database IDs.

Actual Result:
PASS - All VM.STOP event descriptions correctly display the VM UUID (8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26) instead of internal numeric IDs.

Test Evidence:

(localcloud) 🐱 > stop virtualmachine id=8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26 force=true
{
  "virtualmachine": {
    "id": "8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
    "name": "test-pr12502-vm1",
    "state": "Stopped"
    ...
  }
}

(localcloud) 🐱 > list events type=VM.STOP
{
  "count": 3,
  "event": [
    {
      "created": "2026-01-30T10:39:29+0000",
      "description": "Stopping User Instance with ID: 8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourceid": "8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourcename": "test-pr12502-vm1",
      "state": "Scheduled",
      "type": "VM.STOP"
    },
    {
      "created": "2026-01-30T10:39:29+0000",
      "description": "Stopping Vm. Instance ID: 8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourceid": "8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourcename": "test-pr12502-vm1",
      "state": "Started",
      "type": "VM.STOP"
    },
    {
      "created": "2026-01-30T10:40:05+0000",
      "description": "Successfully completed stopping Vm. Instance ID: 8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourceid": "8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourcename": "test-pr12502-vm1",
      "state": "Completed",
      "type": "VM.STOP"
    }
  ]
}

TC3: Start Virtual Machine - Event Description UUID Verification

Objective:
Verify that VM.START event descriptions display resource UUIDs instead of internal database IDs after PR #12502 implementation.

Test Steps:

  1. Start the stopped virtual machine using its UUID
  2. Query VM.START events to examine the event descriptions
  3. Verify that resource identifiers in event descriptions are UUIDs (36-character format) and not internal numeric IDs

Expected Result:
Event descriptions should contain UUIDs (e.g., 8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26) instead of internal numeric database IDs.

Actual Result:
PASS - All VM.START event descriptions correctly display the VM UUID (8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26) instead of internal numeric IDs.

Test Evidence:

(localcloud) 🐱 > start virtualmachine id=8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26
{
  "virtualmachine": {
    "id": "8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
    "name": "test-pr12502-vm1",
    "state": "Running"
    ...
  }
}

(localcloud) 🐱 > list events type=VM.START
{
  "count": 3,
  "event": [
    {
      "created": "2026-01-30T10:41:18+0000",
      "description": "Starting User Instance with ID: 8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourceid": "8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourcename": "test-pr12502-vm1",
      "state": "Scheduled",
      "type": "VM.START"
    },
    {
      "created": "2026-01-30T10:41:18+0000",
      "description": "Starting Vm. Instance ID: 8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourceid": "8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourcename": "test-pr12502-vm1",
      "state": "Started",
      "type": "VM.START"
    },
    {
      "created": "2026-01-30T10:41:22+0000",
      "description": "Successfully completed starting Vm. Instance ID: 8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourceid": "8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourcename": "test-pr12502-vm1",
      "state": "Completed",
      "type": "VM.START"
    }
  ]
}

TC4: Reboot Virtual Machine - Event Description UUID Verification

Objective:
Verify that VM.REBOOT event descriptions display resource UUIDs instead of internal database IDs after PR #12502 implementation.

Test Steps:

  1. Reboot the running virtual machine using its UUID
  2. Query VM.REBOOT events to examine the event descriptions
  3. Verify that resource identifiers in event descriptions are UUIDs (36-character format) and not internal numeric IDs

Expected Result:
Event descriptions should contain UUIDs (e.g., 8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26) instead of internal numeric database IDs.

Actual Result:
PASS - All VM.REBOOT event descriptions correctly display the VM UUID (8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26) instead of internal numeric IDs.

Test Evidence:

(localcloud) 🐱 > reboot virtualmachine id=8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26
{
  "virtualmachine": {
    "id": "8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
    "name": "test-pr12502-vm1",
    "state": "Running"
    ...
  }
}

(localcloud) 🐱 > list events type=VM.REBOOT
{
  "count": 3,
  "event": [
    {
      "created": "2026-01-30T10:42:26+0000",
      "description": "Rebooting User Instance with ID: 8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourceid": "8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourcename": "test-pr12502-vm1",
      "state": "Scheduled",
      "type": "VM.REBOOT"
    },
    {
      "created": "2026-01-30T10:42:26+0000",
      "description": "Rebooting Vm. Instance ID: 8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourceid": "8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourcename": "test-pr12502-vm1",
      "state": "Started",
      "type": "VM.REBOOT"
    },
    {
      "created": "2026-01-30T10:42:28+0000",
      "description": "Successfully completed rebooting Vm. Instance ID: 8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourceid": "8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourcename": "test-pr12502-vm1",
      "state": "Completed",
      "type": "VM.REBOOT"
    }
  ]
}

TC5: Destroy Virtual Machine - Event Description UUID Verification

Objective:
Verify that VM.DESTROY event descriptions display resource UUIDs instead of internal database IDs after PR #12502 implementation.

Test Steps:

  1. Destroy the virtual machine using its UUID with expunge=true
  2. Query VM.DESTROY events to examine the event descriptions
  3. Verify that resource identifiers in event descriptions are UUIDs (36-character format) and not internal numeric IDs

Expected Result:
Event descriptions should contain UUIDs (e.g., 8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26) instead of internal numeric database IDs.

Actual Result:
PASS - All VM.DESTROY event descriptions correctly display the VM UUID (8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26) instead of internal numeric IDs.

Test Evidence:

(localcloud) 🐱 > destroy virtualmachine id=8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26 expunge=true
{
  "virtualmachine": {
    "affinitygroup": [],
    "deleteprotection": false,
    "nic": [],
    "securitygroup": [],
    "tags": []
  }
}

(localcloud) 🐱 > list events type=VM.DESTROY
{
  "count": 3,
  "event": [
    {
      "created": "2026-01-30T10:43:18+0000",
      "description": "Destroying Instance with ID: 8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourceid": "8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourcename": "test-pr12502-vm1",
      "state": "Scheduled",
      "type": "VM.DESTROY"
    },
    {
      "created": "2026-01-30T10:43:18+0000",
      "description": "Destroying Vm. Instance ID: 8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourceid": "8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourcename": "test-pr12502-vm1",
      "state": "Started",
      "type": "VM.DESTROY"
    },
    {
      "created": "2026-01-30T10:45:29+0000",
      "description": "Successfully completed destroying Vm. Instance ID: 8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourceid": "8c8f29e0-6c71-4d6c-96a5-f5a4ef707e26",
      "resourcename": "test-pr12502-vm1",
      "state": "Completed",
      "type": "VM.DESTROY"
    }
  ]
}

TC6: Create Volume - Event Description UUID Verification

Objective:
Verify that VOLUME.CREATE event descriptions display resource UUIDs instead of internal database IDs after PR #12502 implementation.

Test Steps:

  1. Create a data volume using disk offering UUID and zone UUID
  2. Query VOLUME.CREATE events to examine the event descriptions
  3. Verify that resource identifiers in event descriptions are UUIDs (36-character format) and not internal numeric IDs

Expected Result:
Event descriptions should contain UUIDs (e.g., 727218f1-579b-41c6-8c86-6699e5a954b5) instead of internal numeric database IDs.

Actual Result:
PASS - All VOLUME.CREATE event descriptions correctly display Volume UUIDs and Instance UUIDs instead of internal numeric IDs.

Test Evidence:

(localcloud) 🐱 > create volume name=test-pr12502-vol1 diskofferingid=23b0ec46-2cfc-4d22-940a-be8b8b256d5f zoneid=f7467ddc-d2ae-490f-af3e-5e632f580381
{
  "volume": {
    "id": "727218f1-579b-41c6-8c86-6699e5a954b5",
    "name": "test-pr12502-vol1",
    "state": "Allocated",
    "diskofferingid": "23b0ec46-2cfc-4d22-940a-be8b8b256d5f",
    "zoneid": "f7467ddc-d2ae-490f-af3e-5e632f580381"
    ...
  }
}

(localcloud) 🐱 > list events type=VOLUME.CREATE
{
  "count": 7,
  "event": [
    {
      "created": "2026-01-30T10:50:28+0000",
      "description": "Successfully created entity for creating volume. Volume ID: 727218f1-579b-41c6-8c86-6699e5a954b5",
      "resourceid": "727218f1-579b-41c6-8c86-6699e5a954b5",
      "resourcename": "test-pr12502-vol1",
      "state": "Created",
      "type": "VOLUME.CREATE"
    },
    {
      "created": "2026-01-30T10:50:28+0000",
      "description": "Creating volume test-pr12502-vol1",
      "resourceid": "727218f1-579b-41c6-8c86-6699e5a954b5",
      "resourcename": "test-pr12502-vol1",
      "state": "Scheduled",
      "type": "VOLUME.CREATE"
    },
    {
      "created": "2026-01-30T10:50:28+0000",
      "description": "Creating volume. Volume ID: 727218f1-579b-41c6-8c86-6699e5a954b5",
      "resourceid": "727218f1-579b-41c6-8c86-6699e5a954b5",
      "resourcename": "test-pr12502-vol1",
      "state": "Started",
      "type": "VOLUME.CREATE"
    },
    {
      "created": "2026-01-30T10:50:28+0000",
      "description": "Successfully completed creating volume. Volume ID: 727218f1-579b-41c6-8c86-6699e5a954b5",
      "resourceid": "727218f1-579b-41c6-8c86-6699e5a954b5",
      "resourcename": "test-pr12502-vol1",
      "state": "Completed",
      "type": "VOLUME.CREATE"
    }
  ]
}

TC7: Attach Volume - Event Description UUID Verification

Objective:
Verify that VOLUME.ATTACH event descriptions display resource UUIDs instead of internal database IDs after PR #12502 implementation.

Test Steps:

  1. Attach a data volume to a running virtual machine using their UUIDs
  2. Query VOLUME.ATTACH events to examine the event descriptions
  3. Verify that both Volume ID and Instance ID in event descriptions are UUIDs (36-character format) and not internal numeric IDs

Expected Result:
Event descriptions should contain UUIDs for both volume and VM (e.g., 727218f1-579b-41c6-8c86-6699e5a954b5 and 30cf1d51-ccb4-4a3d-89c1-266234db2861) instead of internal numeric database IDs.

Actual Result:
PASS - All VOLUME.ATTACH event descriptions correctly display both Volume UUID (727218f1-579b-41c6-8c86-6699e5a954b5) and Instance UUID (30cf1d51-ccb4-4a3d-89c1-266234db2861) instead of internal numeric IDs.

Test Evidence:

(localcloud) 🐱 > attach volume id=727218f1-579b-41c6-8c86-6699e5a954b5 virtualmachineid=30cf1d51-ccb4-4a3d-89c1-266234db2861
{
  "volume": {
    "id": "727218f1-579b-41c6-8c86-6699e5a954b5",
    "name": "test-pr12502-vol1",
    "state": "Ready",
    "virtualmachineid": "30cf1d51-ccb4-4a3d-89c1-266234db2861",
    "vmdisplayname": "test-pr12502-vm2"
    ...
  }
}

(localcloud) 🐱 > list events type=VOLUME.ATTACH
{
  "count": 3,
  "event": [
    {
      "created": "2026-01-30T10:51:59+0000",
      "description": "Attaching volume with ID: 727218f1-579b-41c6-8c86-6699e5a954b5 to Instance with ID: 30cf1d51-ccb4-4a3d-89c1-266234db2861",
      "resourceid": "727218f1-579b-41c6-8c86-6699e5a954b5",
      "resourcename": "test-pr12502-vol1",
      "state": "Scheduled",
      "type": "VOLUME.ATTACH"
    },
    {
      "created": "2026-01-30T10:51:59+0000",
      "description": "Attaching volume. Volume ID: 727218f1-579b-41c6-8c86-6699e5a954b5 Instance ID: 30cf1d51-ccb4-4a3d-89c1-266234db2861",
      "resourceid": "727218f1-579b-41c6-8c86-6699e5a954b5",
      "resourcename": "test-pr12502-vol1",
      "state": "Started",
      "type": "VOLUME.ATTACH"
    },
    {
      "created": "2026-01-30T10:52:01+0000",
      "description": "Successfully completed attaching volume. Volume ID: 727218f1-579b-41c6-8c86-6699e5a954b5 Instance ID: 30cf1d51-ccb4-4a3d-89c1-266234db2861",
      "resourceid": "727218f1-579b-41c6-8c86-6699e5a954b5",
      "resourcename": "test-pr12502-vol1",
      "state": "Completed",
      "type": "VOLUME.ATTACH"
    }
  ]
}

TC8: Detach Volume - Event Description UUID Verification

Objective:
Verify that VOLUME.DETACH event descriptions display resource UUIDs instead of internal database IDs after PR #12502 implementation.

Test Steps:

  1. Detach a data volume from a running virtual machine using the volume UUID
  2. Query VOLUME.DETACH events to examine the event descriptions
  3. Verify that Volume ID in event descriptions is a UUID (36-character format) and not an internal numeric ID

Expected Result:
Event descriptions should contain Volume UUID (e.g., 727218f1-579b-41c6-8c86-6699e5a954b5) instead of internal numeric database IDs.

Actual Result:
PASS - Volume UUID (727218f1-579b-41c6-8c86-6699e5a954b5) is correctly displayed in event descriptions instead of internal numeric IDs.

Observation: The event description contains an unexpected error message fragment: <error: either volume id or deviceId/vmId need to be specified>. This appears to be a pre-existing formatting issue in the DetachVolumeCmd event description, not related to the UUID change in PR #12502. The operation completed successfully.

Test Evidence:

(localcloud) 🐱 > detach volume id=727218f1-579b-41c6-8c86-6699e5a954b5
{
  "volume": {
    "id": "727218f1-579b-41c6-8c86-6699e5a954b5",
    "name": "test-pr12502-vol1",
    "state": "Ready"
    ...
  }
}

(localcloud) 🐱 > list events type=VOLUME.DETACH
{
  "count": 3,
  "event": [
    {
      "created": "2026-01-30T10:53:58+0000",
      "description": "Detaching volume: 727218f1-579b-41c6-8c86-6699e5a954b5 <error:  either volume id or deviceId/vmId need to be specified>",
      "resourceid": "727218f1-579b-41c6-8c86-6699e5a954b5",
      "resourcename": "test-pr12502-vol1",
      "state": "Scheduled",
      "type": "VOLUME.DETACH"
    },
    {
      "created": "2026-01-30T10:53:58+0000",
      "description": "Detaching volume. Detaching volume: 727218f1-579b-41c6-8c86-6699e5a954b5 <error:  either volume id or deviceId/vmId need to be specified>",
      "resourceid": "727218f1-579b-41c6-8c86-6699e5a954b5",
      "resourcename": "test-pr12502-vol1",
      "state": "Started",
      "type": "VOLUME.DETACH"
    },
    {
      "created": "2026-01-30T10:53:59+0000",
      "description": "Successfully completed detaching volume. Detaching volume: 727218f1-579b-41c6-8c86-6699e5a954b5 <error:  either volume id or deviceId/vmId need to be specified>",
      "resourceid": "727218f1-579b-41c6-8c86-6699e5a954b5",
      "resourcename": "test-pr12502-vol1",
      "state": "Completed",
      "type": "VOLUME.DETACH"
    }
  ]
}

TC9: Create Snapshot - Event Description UUID Verification

Objective:
Verify that SNAPSHOT.CREATE event descriptions display resource UUIDs instead of internal database IDs after PR #12502 implementation.

Test Steps:

  1. Create a snapshot of a ROOT volume using the volume UUID
  2. Query SNAPSHOT.CREATE events to examine the event descriptions
  3. Verify that Volume ID in event descriptions is a UUID (36-character format) and not an internal numeric ID

Expected Result:
Event descriptions should contain Volume UUID (e.g., 4c5981dd-f3d4-423e-a89e-1cb695964d39) instead of internal numeric database IDs.

Actual Result:
PASS - SNAPSHOT.CREATE event description correctly displays Volume UUID (4c5981dd-f3d4-423e-a89e-1cb695964d39) instead of internal numeric IDs.

Test Evidence:

(localcloud) 🐱 > create snapshot volumeid=4c5981dd-f3d4-423e-a89e-1cb695964d39
{
  "snapshot": {
    "id": "fac5b8e8-837c-40e6-bde7-903edb82d24d",
    "name": "test-pr12502-vm2_ROOT-5_20260130105511",
    "state": "BackedUp",
    "volumeid": "4c5981dd-f3d4-423e-a89e-1cb695964d39"
    ...
  }
}

(localcloud) 🐱 > list events type=SNAPSHOT.CREATE
{
  "count": 4,
  "event": [
    {
      "created": "2026-01-30T10:55:11+0000",
      "description": "Successfully created entity for allocating snapshot",
      "resourceid": "fac5b8e8-837c-40e6-bde7-903edb82d24d",
      "resourcename": "test-pr12502-vm2_ROOT-5_20260130105511",
      "state": "Created",
      "type": "SNAPSHOT.CREATE"
    },
    {
      "created": "2026-01-30T10:55:11+0000",
      "description": "Creating Snapshot for volume: 4c5981dd-f3d4-423e-a89e-1cb695964d39",
      "resourceid": "fac5b8e8-837c-40e6-bde7-903edb82d24d",
      "resourcename": "test-pr12502-vm2_ROOT-5_20260130105511",
      "state": "Scheduled",
      "type": "SNAPSHOT.CREATE"
    },
    {
      "created": "2026-01-30T10:55:11+0000",
      "description": "Taking snapshot",
      "resourceid": "fac5b8e8-837c-40e6-bde7-903edb82d24d",
      "resourcename": "test-pr12502-vm2_ROOT-5_20260130105511",
      "state": "Started",
      "type": "SNAPSHOT.CREATE"
    },
    {
      "created": "2026-01-30T10:55:31+0000",
      "description": "Successfully completed taking snapshot",
      "resourceid": "fac5b8e8-837c-40e6-bde7-903edb82d24d",
      "resourcename": "test-pr12502-vm2_ROOT-5_20260130105511",
      "state": "Completed",
      "type": "SNAPSHOT.CREATE"
    }
  ]
}

TC10: Delete Snapshot - Event Description UUID Verification

Objective:
Verify that SNAPSHOT.DELETE event descriptions display resource UUIDs instead of internal database IDs after PR #12502 implementation.

Test Steps:

  1. Attempt to delete a snapshot using its UUID
  2. Query SNAPSHOT.DELETE events to examine the event descriptions
  3. Verify that Snapshot ID in event descriptions is a UUID (36-character format) and not an internal numeric ID

Expected Result:
Event descriptions should contain Snapshot UUID (e.g., fac5b8e8-837c-40e6-bde7-903edb82d24d) instead of internal numeric database IDs.

Actual Result:
PASS - SNAPSHOT.DELETE event descriptions correctly display Snapshot UUID (fac5b8e8-837c-40e6-bde7-903edb82d24d) instead of internal numeric IDs. Note: The actual delete operation failed due to an infrastructure state condition issue, but the UUID display in events is correct.

Test Evidence:

(localcloud) 🐱 > delete snapshot id=fac5b8e8-837c-40e6-bde7-903edb82d24d
{
  "jobresult": {
    "errorcode": 530,
    "errortext": "Problem with condition: state"
  }
}

(localcloud) 🐱 > list events type=SNAPSHOT.DELETE
{
  "count": 9,
  "event": [
    {
      "created": "2026-01-30T10:59:38+0000",
      "description": "Deleting Snapshot with ID: fac5b8e8-837c-40e6-bde7-903edb82d24d",
      "resourceid": "fac5b8e8-837c-40e6-bde7-903edb82d24d",
      "resourcename": "test-pr12502-vm2_ROOT-5_20260130105511",
      "state": "Scheduled",
      "type": "SNAPSHOT.DELETE"
    },
    {
      "created": "2026-01-30T10:59:38+0000",
      "description": "Deleting snapshot. Snapshot ID: fac5b8e8-837c-40e6-bde7-903edb82d24d",
      "resourceid": "fac5b8e8-837c-40e6-bde7-903edb82d24d",
      "resourcename": "test-pr12502-vm2_ROOT-5_20260130105511",
      "state": "Started",
      "type": "SNAPSHOT.DELETE"
    },
    {
      "created": "2026-01-30T10:59:38+0000",
      "description": "Error while deleting snapshot. Snapshot ID: fac5b8e8-837c-40e6-bde7-903edb82d24d",
      "level": "ERROR",
      "resourceid": "fac5b8e8-837c-40e6-bde7-903edb82d24d",
      "resourcename": "test-pr12502-vm2_ROOT-5_20260130105511",
      "state": "Completed",
      "type": "SNAPSHOT.DELETE"
    }
  ]
}

TC11: Restart Network - Event Description UUID Verification

Objective:
Verify that NETWORK.RESTART event descriptions display resource UUIDs instead of internal database IDs after PR #12502 implementation.

Test Steps:

  1. Restart an isolated guest network using its UUID
  2. Query NETWORK.RESTART events to examine the event descriptions
  3. Verify that Network ID in event descriptions is a UUID (36-character format) and not an internal numeric ID

Expected Result:
Event descriptions should contain Network UUID (e.g., b267d5f8-02c1-4ab6-98e8-04b49c80281c) instead of internal numeric database IDs.

Actual Result:
PASS - NETWORK.RESTART event description correctly displays Network UUID (b267d5f8-02c1-4ab6-98e8-04b49c80281c) instead of internal numeric IDs.

Test Evidence:

(localcloud) 🐱 > restart network id=b267d5f8-02c1-4ab6-98e8-04b49c80281c
{
  "success": true
}

(localcloud) 🐱 > list events type=NETWORK.RESTART
{
  "count": 3,
  "event": [
    {
      "created": "2026-01-30T11:34:06+0000",
      "description": "Restarting Network with ID: b267d5f8-02c1-4ab6-98e8-04b49c80281c",
      "resourceid": "b267d5f8-02c1-4ab6-98e8-04b49c80281c",
      "resourcename": "admin-network",
      "state": "Scheduled",
      "type": "NETWORK.RESTART"
    },
    {
      "created": "2026-01-30T11:34:06+0000",
      "description": "Restarting network",
      "resourceid": "b267d5f8-02c1-4ab6-98e8-04b49c80281c",
      "resourcename": "admin-network",
      "state": "Started",
      "type": "NETWORK.RESTART"
    },
    {
      "created": "2026-01-30T11:34:08+0000",
      "description": "Successfully completed restarting network",
      "resourceid": "b267d5f8-02c1-4ab6-98e8-04b49c80281c",
      "resourcename": "admin-network",
      "state": "Completed",
      "type": "NETWORK.RESTART"
    }
  ]
}

TC12: Create Firewall Rule - Event Description UUID Verification

Objective:
Verify that FIREWALL.OPEN event descriptions display resource UUIDs instead of internal database IDs after PR #12502 implementation.

Test Steps:

  1. Create an ingress firewall rule on a public IP address using the IP address UUID
  2. Query FIREWALL.OPEN events to examine the event descriptions
  3. Verify that Rule ID in event descriptions is a UUID (36-character format) and not an internal numeric ID

Expected Result:
Event descriptions should contain Firewall Rule UUID (e.g., 5fe0c3d1-3ebf-43e6-8e65-eca11b62b9d1) instead of internal numeric database IDs.

Actual Result:
PASS - FIREWALL.OPEN event descriptions correctly display Firewall Rule UUID (5fe0c3d1-3ebf-43e6-8e65-eca11b62b9d1) instead of internal numeric IDs.

Test Evidence:

(localcloud) 🐱 > create firewallrule ipaddressid=fad0ada7-a650-471b-b13b-616b7affac89 protocol=TCP startport=8080 endport=8080 cidrlist=0.0.0.0/0
{
  "firewallrule": {
    "id": "5fe0c3d1-3ebf-43e6-8e65-eca11b62b9d1",
    "ipaddress": "10.0.53.143",
    "ipaddressid": "fad0ada7-a650-471b-b13b-616b7affac89",
    "protocol": "tcp",
    "startport": 8080,
    "endport": 8080,
    "state": "Active"
    ...
  }
}

(localcloud) 🐱 > list events type=FIREWALL.OPEN
{
  "count": 5,
  "event": [
    {
      "created": "2026-01-30T11:35:08+0000",
      "description": "Successfully created entity for creating firewall rule. Rule ID: 5fe0c3d1-3ebf-43e6-8e65-eca11b62b9d1",
      "resourceid": "5fe0c3d1-3ebf-43e6-8e65-eca11b62b9d1",
      "state": "Created",
      "type": "FIREWALL.OPEN"
    },
    {
      "created": "2026-01-30T11:35:08+0000",
      "description": "Creating firewall rule for IP: 10.0.53.143 for protocol:TCP",
      "resourceid": "5fe0c3d1-3ebf-43e6-8e65-eca11b62b9d1",
      "state": "Scheduled",
      "type": "FIREWALL.OPEN"
    },
    {
      "created": "2026-01-30T11:35:08+0000",
      "description": "Creating firewall rule. Rule ID: 5fe0c3d1-3ebf-43e6-8e65-eca11b62b9d1",
      "resourceid": "5fe0c3d1-3ebf-43e6-8e65-eca11b62b9d1",
      "state": "Started",
      "type": "FIREWALL.OPEN"
    },
    {
      "created": "2026-01-30T11:35:09+0000",
      "description": "Successfully completed creating firewall rule. Rule ID: 5fe0c3d1-3ebf-43e6-8e65-eca11b62b9d1",
      "resourceid": "5fe0c3d1-3ebf-43e6-8e65-eca11b62b9d1",
      "state": "Completed",
      "type": "FIREWALL.OPEN"
    }
  ]
}

TC13: Host Prepare for Maintenance - Event Description UUID Verification

Objective:
Verify that MAINT.PREPARE event descriptions display resource UUIDs instead of internal database IDs after PR #12502 implementation.

Test Steps:

  1. Prepare a host for maintenance using its UUID
  2. Query MAINT.PREPARE events to examine the event descriptions
  3. Verify that Host ID in event descriptions is a UUID (36-character format) and not an internal numeric ID

Expected Result:
Event descriptions should contain Host UUID (e.g., 860d81ad-d8ac-48d3-9138-6d89283db68e) instead of internal numeric database IDs.

Actual Result:
PASS - MAINT.PREPARE event descriptions correctly display Host UUID (860d81ad-d8ac-48d3-9138-6d89283db68e) instead of internal numeric IDs.

Test Evidence:

(localcloud) 🐱 > prepare hostformaintenance id=860d81ad-d8ac-48d3-9138-6d89283db68e
{
  "host": {
    "id": "860d81ad-d8ac-48d3-9138-6d89283db68e",
    "name": "ref-trl-10773-k-Mol9-rositsa-kyuchukova-kvm2",
    "resourcestate": "PrepareForMaintenance",
    "state": "Up"
    ...
  }
}

(localcloud) 🐱 > list events keyword=Maintenance
{
  "count": 4,
  "event": [
    {
      "created": "2026-01-30T11:36:42+0000",
      "description": "Preparing host with ID: 860d81ad-d8ac-48d3-9138-6d89283db68e for maintenance.",
      "resourceid": "860d81ad-d8ac-48d3-9138-6d89283db68e",
      "resourcename": "ref-trl-10773-k-Mol9-rositsa-kyuchukova-kvm2",
      "state": "Scheduled",
      "type": "MAINT.PREPARE"
    },
    {
      "created": "2026-01-30T11:36:42+0000",
      "description": "Prepare maintenance for host",
      "resourceid": "860d81ad-d8ac-48d3-9138-6d89283db68e",
      "resourcename": "ref-trl-10773-k-Mol9-rositsa-kyuchukova-kvm2",
      "state": "Started",
      "type": "MAINT.PREPARE"
    },
    {
      "created": "2026-01-30T11:36:43+0000",
      "description": "starting maintenance for host Host {\"id\":2,\"name\":\"ref-trl-10773-k-Mol9-rositsa-kyuchukova-kvm2\",\"type\":\"Routing\",\"uuid\":\"860d81ad-d8ac-48d3-9138-6d89283db68e\"}",
      "resourceid": "860d81ad-d8ac-48d3-9138-6d89283db68e",
      "resourcename": "ref-trl-10773-k-Mol9-rositsa-kyuchukova-kvm2",
      "state": "Started",
      "type": "MAINT.PREPARE"
    },
    {
      "created": "2026-01-30T11:36:43+0000",
      "description": "Successfully completed prepare maintenance for host",
      "resourceid": "860d81ad-d8ac-48d3-9138-6d89283db68e",
      "resourcename": "ref-trl-10773-k-Mol9-rositsa-kyuchukova-kvm2",
      "state": "Completed",
      "type": "MAINT.PREPARE"
    }
  ]
}

TC14: Enable HA for Host - Event Description UUID Verification

Objective:
Verify that HA.RESOURCE.ENABLE event descriptions display resource UUIDs instead of internal database IDs after PR #12502 implementation.

Test Steps:

  1. Attempt to enable HA for a host using its UUID
  2. Query HA.RESOURCE.ENABLE events to examine the event descriptions
  3. Verify that Host ID in event descriptions is a UUID (36-character format) and not an internal numeric ID

Expected Result:
Event descriptions should contain Host UUID (e.g., 860d81ad-d8ac-48d3-9138-6d89283db68e) instead of internal numeric database IDs.

Actual Result:
PASS - HA.RESOURCE.ENABLE event description correctly displays Host UUID (860d81ad-d8ac-48d3-9138-6d89283db68e) instead of internal numeric IDs. Note: The operation failed due to missing HAProvider configuration, but the UUID display in events is correct.

Test Evidence:

(localcloud) 🐱 > enable haforhost hostid=860d81ad-d8ac-48d3-9138-6d89283db68e
{
  "jobresult": {
    "errorcode": 431,
    "errortext": "HAProvider is not provided for the resource [2], failing configuration."
  },
  "jobstatus": 2
}
🙈 Error: async API failed for job 95995897-2747-4ae0-b535-5dc0a1ac9065

(localcloud) 🐱 > list events keyword=HA
{
  "count": 3,
  "event": [
    {
      "created": "2026-01-30T11:38:35+0000",
      "description": "Enabling HA for host with ID: 860d81ad-d8ac-48d3-9138-6d89283db68e",
      "state": "Scheduled",
      "type": "HA.RESOURCE.ENABLE"
    },
    {
      "created": "2026-01-30T11:38:35+0000",
      "description": "Error while enabling HA for resource",
      "level": "ERROR",
      "state": "Completed",
      "type": "HA.RESOURCE.ENABLE"
    }
  ]
}

TC15: Create Domain - Event Description UUID Verification

Objective:
Verify that DOMAIN.CREATE event descriptions display resource UUIDs instead of internal database IDs after PR #12502 implementation.

Test Steps:

  1. Create a new domain
  2. Query DOMAIN.CREATE events to examine the event descriptions
  3. Verify that resource identifiers in event descriptions are UUIDs or names (not internal numeric IDs)

Expected Result:
Event descriptions should contain domain name or UUID instead of internal numeric database IDs.

Actual Result:
PASS - DOMAIN.CREATE event description correctly displays the domain name (test-pr12502-domain) and the resourceid field shows the proper UUID (35fd4e71-f583-4020-b9eb-b39ada1f3754) instead of internal numeric IDs.

Test Evidence:

(localcloud) 🐱 > create domain name=test-pr12502-domain
{
  "domain": {
    "id": "35fd4e71-f583-4020-b9eb-b39ada1f3754",
    "name": "test-pr12502-domain",
    "parentdomainid": "58471e30-fdba-11f0-948c-1e00f3000407",
    "path": "ROOT/test-pr12502-domain"
    ...
  }
}

(localcloud) 🐱 > list events type=DOMAIN.CREATE
{
  "count": 1,
  "event": [
    {
      "created": "2026-01-30T11:39:18+0000",
      "description": "Successfully completed creating Domain. Domain Name: test-pr12502-domain",
      "resourceid": "35fd4e71-f583-4020-b9eb-b39ada1f3754",
      "resourcename": "test-pr12502-domain",
      "resourcetype": "Domain",
      "state": "Completed",
      "type": "DOMAIN.CREATE"
    }
  ]
}

TC16: Disable Account - Event Description UUID Verification

Objective:
Verify that ACCOUNT.DISABLE event descriptions display resource UUIDs instead of internal database IDs after PR #12502 implementation.

Test Steps:

  1. Create a test account in a test domain
  2. Disable the account using the account name and domain UUID
  3. Query ACCOUNT.DISABLE events to examine the event descriptions
  4. Verify that Domain ID in event descriptions is a UUID (36-character format) and not an internal numeric ID

Expected Result:
Event descriptions should contain Domain UUID (e.g., 35fd4e71-f583-4020-b9eb-b39ada1f3754) instead of internal numeric database IDs.

Actual Result:
FAIL - ACCOUNT.DISABLE event description shows internal numeric Domain ID (Domain Id:2) instead of UUID (35fd4e71-f583-4020-b9eb-b39ada1f3754).

Additional Finding: Comparison with ACCOUNT.ENABLE shows that EnableAccountCmd does not include Domain ID in the description at all, while DisableAccountCmd includes it as a numeric ID. This suggests DisableAccountCmd was not fully updated in PR #12502.

Test Evidence:

(localcloud) 🐱 > disable account account=testuser domainid=35fd4e71-f583-4020-b9eb-b39ada1f3754 lock=false
{
  "account": {
    "id": "d344f781-f8e2-45c1-ae5c-458482abfcfa",
    "name": "testuser",
    "domainid": "35fd4e71-f583-4020-b9eb-b39ada1f3754",
    "state": "disabled"
  }
}

(localcloud) 🐱 > list events type=ACCOUNT.DISABLE
{
  "event": [
    {
      "description": "Disabling account. Account Name: testuser, Domain Id:2",  <-- BUG: Should be UUID
      "state": "Started",
      "type": "ACCOUNT.DISABLE"
    },
    {
      "description": "Successfully completed disabling account. Account Name: testuser, Domain Id:2",  <-- BUG: Should be UUID
      "resourceid": "d344f781-f8e2-45c1-ae5c-458482abfcfa",
      "state": "Completed",
      "type": "ACCOUNT.DISABLE"
    }
  ]
}

# Comparison with ACCOUNT.ENABLE (no Domain ID in description)
(localcloud) 🐱 > list events type=ACCOUNT.ENABLE
{
  "event": [
    {
      "description": "Enabling account",
      "state": "Started",
      "type": "ACCOUNT.ENABLE"
    },
    {
      "description": "Successfully completed enabling account",
      "resourceid": "d344f781-f8e2-45c1-ae5c-458482abfcfa",
      "state": "Completed",
      "type": "ACCOUNT.ENABLE"
    }
  ]
}

Bug Location: DisableAccountCmd.java - The getEventDescription() method likely uses getDomainId() (internal ID) instead of getResourceUuid(ApiConstants.DOMAIN_ID).

TC17: Reboot SSVM - Event Description UUID Verification

Objective:
Verify that SSVM.REBOOT event descriptions display resource UUIDs instead of internal database IDs after PR #12502 implementation.

Test Steps:

  1. Identify the Secondary Storage VM using list systemvms
  2. Reboot the SSVM using its UUID
  3. Query SSVM.REBOOT events to examine the event descriptions
  4. Verify that System VM ID in event descriptions is a UUID (36-character format) and not an internal numeric ID

Expected Result:
Event descriptions should contain System VM UUID (e.g., b2a43d63-3d18-47bc-8206-1b562e09a82e) instead of internal numeric database IDs.

Actual Result:
PASS - SSVM.REBOOT event description correctly displays System VM UUID (b2a43d63-3d18-47bc-8206-1b562e09a82e) instead of internal numeric IDs.

Test Evidence:

(localcloud) 🐱 > list systemvms systemvmtype=secondarystoragevm
{
  "systemvm": [
    {
      "id": "b2a43d63-3d18-47bc-8206-1b562e09a82e",
      "name": "s-2-VM",
      "state": "Running",
      "systemvmtype": "secondarystoragevm"
      ...
    }
  ]
}

(localcloud) 🐱 > reboot systemvm id=b2a43d63-3d18-47bc-8206-1b562e09a82e
{
  "systemvm": {
    "id": "b2a43d63-3d18-47bc-8206-1b562e09a82e",
    "name": "s-2-VM",
    "state": "Running"
    ...
  }
}

(localcloud) 🐱 > list events type=SSVM.REBOOT
{
  "count": 2,
  "event": [
    {
      "created": "2026-01-30T11:41:49+0000",
      "description": "Rebooting System VM with ID: b2a43d63-3d18-47bc-8206-1b562e09a82e",
      "resourceid": "b2a43d63-3d18-47bc-8206-1b562e09a82e",
      "resourcename": "s-2-VM",
      "state": "Scheduled",
      "type": "SSVM.REBOOT"
    },
    {
      "created": "2026-01-30T11:41:49+0000",
      "description": "rebooting secondary storage VM",
      "resourceid": "b2a43d63-3d18-47bc-8206-1b562e09a82e",
      "resourcename": "s-2-VM",
      "state": "Started",
      "type": "SSVM.REBOOT"
    }
  ]
}

TC18: Reboot Router - Event Description UUID Verification

Objective:
Verify that ROUTER.REBOOT event descriptions display resource UUIDs instead of internal database IDs after PR #12502 implementation.

Test Steps:

  1. Identify the Virtual Router using list routers
  2. Reboot the router using its UUID
  3. Query ROUTER.REBOOT events to examine the event descriptions
  4. Verify that Router ID in event descriptions is a UUID (36-character format) and not an internal numeric ID

Expected Result:
Event descriptions should contain Router UUID (e.g., 454e40bb-9cfc-4a22-ad18-3c87e5d88968) instead of internal numeric database IDs.

Actual Result:
PASS - All ROUTER.REBOOT event descriptions correctly display Router UUID (454e40bb-9cfc-4a22-ad18-3c87e5d88968) instead of internal numeric IDs.

Test Evidence:

(localcloud) 🐱 > list routers
{
  "router": [
    {
      "id": "454e40bb-9cfc-4a22-ad18-3c87e5d88968",
      "name": "r-4-VM",
      "state": "Running"
      ...
    }
  ]
}

(localcloud) 🐱 > reboot router id=454e40bb-9cfc-4a22-ad18-3c87e5d88968
{
  "router": {
    "id": "454e40bb-9cfc-4a22-ad18-3c87e5d88968",
    "name": "r-4-VM",
    "state": "Running"
    ...
  }
}

(localcloud) 🐱 > list events type=ROUTER.REBOOT
{
  "count": 3,
  "event": [
    {
      "created": "2026-01-30T11:42:58+0000",
      "description": "Rebooting router with ID: 454e40bb-9cfc-4a22-ad18-3c87e5d88968",
      "resourceid": "454e40bb-9cfc-4a22-ad18-3c87e5d88968",
      "resourcename": "r-4-VM",
      "state": "Scheduled",
      "type": "ROUTER.REBOOT"
    },
    {
      "created": "2026-01-30T11:42:58+0000",
      "description": "Rebooting router Vm. Router ID: 454e40bb-9cfc-4a22-ad18-3c87e5d88968",
      "resourceid": "454e40bb-9cfc-4a22-ad18-3c87e5d88968",
      "resourcename": "r-4-VM",
      "state": "Started",
      "type": "ROUTER.REBOOT"
    },
    {
      "created": "2026-01-30T11:43:53+0000",
      "description": "Successfully completed rebooting router Vm. Router ID: 454e40bb-9cfc-4a22-ad18-3c87e5d88968",
      "resourceid": "454e40bb-9cfc-4a22-ad18-3c87e5d88968",
      "resourcename": "r-4-VM",
      "state": "Completed",
      "type": "ROUTER.REBOOT"
    }
  ]
}

TC20: Create Project - Event Description UUID Verification

Objective:
Verify that PROJECT.CREATE event descriptions display resource UUIDs instead of internal database IDs after PR #12502 implementation.

Test Steps:

  1. Create a new project
  2. Query PROJECT.CREATE events to examine the event descriptions
  3. Verify that Project ID in event descriptions is a UUID (36-character format) and not an internal numeric ID

Expected Result:
Event descriptions should contain Project UUID (e.g., 9d51d774-37b8-4a4c-9f74-b528db15a129) instead of internal numeric database IDs.

Actual Result:
PASS - PROJECT.CREATE event descriptions correctly display Project UUID (9d51d774-37b8-4a4c-9f74-b528db15a129) instead of internal numeric IDs.

Test Evidence:

(localcloud) 🐱 > create project name=test-pr12502-project displaytext="Test Project for PR 12502"
{
  "project": {
    "id": "9d51d774-37b8-4a4c-9f74-b528db15a129",
    "name": "test-pr12502-project",
    "displaytext": "Test Project for PR 12502",
    "state": "Active"
    ...
  }
}

(localcloud) 🐱 > list events type=PROJECT.CREATE
{
  "count": 4,
  "event": [
    {
      "created": "2026-01-30T11:45:33+0000",
      "description": "Successfully created entity for creating project. Project ID: 9d51d774-37b8-4a4c-9f74-b528db15a129",
      "resourceid": "9d51d774-37b8-4a4c-9f74-b528db15a129",
      "resourcename": "Test Project for PR 12502",
      "state": "Created",
      "type": "PROJECT.CREATE"
    },
    {
      "created": "2026-01-30T11:45:33+0000",
      "description": "creating project",
      "resourceid": "9d51d774-37b8-4a4c-9f74-b528db15a129",
      "resourcename": "Test Project for PR 12502",
      "state": "Scheduled",
      "type": "PROJECT.CREATE"
    },
    {
      "created": "2026-01-30T11:45:33+0000",
      "description": "Creating project",
      "resourceid": "9d51d774-37b8-4a4c-9f74-b528db15a129",
      "resourcename": "Test Project for PR 12502",
      "state": "Started",
      "type": "PROJECT.CREATE"
    },
    {
      "created": "2026-01-30T11:45:33+0000",
      "description": "Successfully completed creating project",
      "resourceid": "9d51d774-37b8-4a4c-9f74-b528db15a129",
      "resourcename": "Test Project for PR 12502",
      "state": "Completed",
      "type": "PROJECT.CREATE"
    }
  ]
}

TC19: Copy Template - Event Description UUID Verification

Objective:
Verify that TEMPLATE.COPY event descriptions display resource UUIDs instead of internal database IDs after PR #12502 implementation.

Test Steps:

  1. Copy a template to a zone using template UUID and zone UUID
  2. Query TEMPLATE.COPY events to examine the event descriptions
  3. Verify that Template ID and Zone ID in event descriptions are UUIDs (36-character format) and not internal numeric IDs

Expected Result:
Event descriptions should contain Template UUID and Zone UUID instead of internal numeric database IDs.

Actual Result:
PASS - TEMPLATE.COPY event descriptions correctly display both Template UUID (585c17ba-fdba-11f0-948c-1e00f3000407) and Zone UUID (f7467ddc-d2ae-490f-af3e-5e632f580381) instead of internal numeric IDs.

Test Evidence:

(localcloud) 🐱 > copy template id=585c17ba-fdba-11f0-948c-1e00f3000407 destzoneid=f7467ddc-d2ae-490f-af3e-5e632f580381
{
  "template": {
    "id": "585c17ba-fdba-11f0-948c-1e00f3000407",
    "name": "CentOS 5.5(64-bit) no GUI (KVM)",
    "zoneid": "f7467ddc-d2ae-490f-af3e-5e632f580381"
    ...
  }
}

(localcloud) 🐱 > list events type=TEMPLATE.COPY
{
  "count": 2,
  "event": [
    {
      "created": "2026-01-30T11:46:51+0000",
      "description": "Copying Template. Copying Template: 585c17ba-fdba-11f0-948c-1e00f3000407 to zones: f7467ddc-d2ae-490f-af3e-5e632f580381, ",
      "resourceid": "585c17ba-fdba-11f0-948c-1e00f3000407",
      "resourcename": "CentOS 5.5(64-bit) no GUI (KVM)",
      "state": "Started",
      "type": "TEMPLATE.COPY"
    },
    {
      "created": "2026-01-30T11:46:51+0000",
      "description": "Successfully completed Copying Template. Copying Template: 585c17ba-fdba-11f0-948c-1e00f3000407 to zones: f7467ddc-d2ae-490f-af3e-5e632f580381, ",
      "resourceid": "585c17ba-fdba-11f0-948c-1e00f3000407",
      "resourcename": "CentOS 5.5(64-bit) no GUI (KVM)",
      "state": "Completed",
      "type": "TEMPLATE.COPY"
    }
  ]
}

@DaanHoogland
Copy link
Contributor

@erikbocks , can you look at @RosiKyu ’s report and address the issue(s)? (I think only one)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make UuidMgr.getUuid(User.class, getId()) a more generic event utility for setting in (usage) events

6 participants