Skip to content

Enhance the listAffinityGroups API by adding the dedicated resources related to an affinity group#9188

Merged
JoaoJandre merged 6 commits into
apache:mainfrom
scclouds:add-details-to-affinity-groups
Sep 10, 2024
Merged

Enhance the listAffinityGroups API by adding the dedicated resources related to an affinity group#9188
JoaoJandre merged 6 commits into
apache:mainfrom
scclouds:add-details-to-affinity-groups

Conversation

@bernardodemarco

Copy link
Copy Markdown
Member

Description

When an affinity group is composed of dedicated resources, the listAffinityGroups API does not show any information about the resources of the group.

This PR, therefore, adds which dedicated resources are related to a given affinity group in the listAffinityGroups API response and displays a link to them in the UI. Furthermore, the affinity groups default title and description were modified in order to reflect the type of the resource that they are associated with.

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

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Screenshots:

Affinity group details for Root Admin users

image

Affinity group details for non Root Admin users

image

How Has This Been Tested?

Tests with a root admin user

  1. I logged in as a root admin.
  2. I dedicated a host called host-02 to the domain ROOT.
  3. I dedicated a host called host-01 to the domain ROOT.
  4. I executed the listAffinityGroups API through CloudMonkey and I got the following response:
listAffinityGroups
{
  "affinitygroup": [
    {
      "account": "system",
      "dedicatedresources": [
        {
          "resourceid": "8a783642-c6a0-4948-8128-61aa73aef8a9",
          "resourcename": "host-02",
          "resourcetype": "Host"
        },
        {
          "resourceid": "8928748b-cf9c-46df-b4c8-b39f476ebad3",
          "resourcename": "host-01",
          "resourcetype": "Host"
        }
      ],
      "description": "Dedicated host group",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "6623fe64-2c01-41ba-bf79-58c8fa7c0e16",
      "name": "DedicatedHostGrp-domain-ROOT",
      "type": "ExplicitDedication"
    }
  ],
  "count": 1
}
  1. Through UI, I accessed the affinity groups submenu and I selected the created group, noticing the following result:
Affinity group details image

image

Tests with a non root admin user

  1. I logged in with an account with the User role.
  2. I executed the listAffinityGroups API through CloudMonkey and I got the following response:
listAffinityGroups
{
  "affinitygroup": [
    {
      "account": "system",
      "description": "Dedicated host group",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "6623fe64-2c01-41ba-bf79-58c8fa7c0e16",
      "name": "DedicatedHostGrp-domain-ROOT",
      "type": "ExplicitDedication"
    }
  ],
  "count": 1
}

As it can be observed, the dedicatedresources field was not returned on the response.

  1. Through UI, I accessed the affinity groups submenu and I selected the created group, noticing the following result:
Affinity group details image

image

@codecov

codecov Bot commented Jun 7, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 0% with 54 lines in your changes missing coverage. Please review.

Project coverage is 15.54%. Comparing base (8ca1843) to head (de9cc41).
Report is 99 commits behind head on main.

Files with missing lines Patch % Lines
.../cloud/api/query/dao/AffinityGroupJoinDaoImpl.java 0.00% 26 Missing ⚠️
...dstack/dedicated/DedicatedResourceManagerImpl.java 0.00% 15 Missing ⚠️
...loudstack/dedicated/DedicatedResourceResponse.java 0.00% 6 Missing ⚠️
...che/cloudstack/affinity/AffinityGroupResponse.java 0.00% 5 Missing ⚠️
...src/main/java/com/cloud/dc/DedicatedResources.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9188      +/-   ##
============================================
- Coverage     15.54%   15.54%   -0.01%     
- Complexity    11996    11998       +2     
============================================
  Files          5499     5501       +2     
  Lines        481706   481751      +45     
  Branches      62623    59402    -3221     
============================================
+ Hits          74884    74886       +2     
- Misses       398536   398578      +42     
- Partials       8286     8287       +1     
Flag Coverage Δ
uitests 4.17% <ø> (+<0.01%) ⬆️
unittests 16.32% <0.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.

@github-actions

Copy link
Copy Markdown

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

@bernardodemarco bernardodemarco force-pushed the add-details-to-affinity-groups branch from d898442 to a35a0e6 Compare June 10, 2024 19:59
@DaanHoogland

Copy link
Copy Markdown
Contributor

@bernardodemarco , I have no time to review now, but did go through your test cases and am wondering about one scenario:

  • one user has access to a group of dedicated resources
  • they make an affinity group that uses shared and dedicated resources
  • another user calls the API for the affinity group
    I am not sure if this is a feasible scenario, but if so I wonder what would happen. Thoughts?

@bernardodemarco

Copy link
Copy Markdown
Member Author

@DaanHoogland, I'm not entirely sure I understand the scenario you proposed. However, here are some more detailed test cases that I believe could fit the proposed scenario.

Test Cases

Environment

  • Accounts: admin (Root Admin) and admin2 (Root Admin)
  • Domains: ROOT
  • Hosts: host-01 and host-02
  • Clusters: cluster-zn-fln-01
  • Pods: pod-zn-fln-01
  • Zones: zn-fln-01

host-01 has been dedicated to admin and host-02 to admin2.

listAffinityGroups for admin
list affinitygroups 
{
  "affinitygroup": [
    {
      "account": "admin",
      "dedicatedresources": [
        {
          "resourceid": "8928748b-cf9c-46df-b4c8-b39f476ebad3",
          "resourcename": "host-01",
          "resourcetype": "Host"
        }
      ],
      "description": "Dedicated host group",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "46fcaeee-ce9f-40a7-9314-68e338c84092",
      "name": "DedicatedHostGrp-admin",
      "type": "ExplicitDedication"
    }
  ],
  "count": 1
}
listAffinityGroups for admin2
list affinitygroups 
{
  "affinitygroup": [
    {
      "account": "admin2",
      "dedicatedresources": [
        {
          "resourceid": "8a783642-c6a0-4948-8128-61aa73aef8a9",
          "resourcename": "host-02",
          "resourcetype": "Host"
        }
      ],
      "description": "Dedicated host group",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "17c28add-86b4-43e7-9cf0-3ba41f6d77f0",
      "name": "DedicatedHostGrp-admin2",
      "type": "ExplicitDedication"
    }
  ],
  "count": 1
}

If the listall parameter is set to true, all affinity groups will be listed for both admins, which is the expected behavior.

listAffinityGroups listall=true output for both admins
listAffinityGroups listall=true
{
  "affinitygroup": [
    {
      "account": "admin2",
      "dedicatedresources": [
        {
          "resourceid": "8a783642-c6a0-4948-8128-61aa73aef8a9",
          "resourcename": "host-02",
          "resourcetype": "Host"
        }
      ],
      "description": "Dedicated host group",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "17c28add-86b4-43e7-9cf0-3ba41f6d77f0",
      "name": "DedicatedHostGrp-admin2",
      "type": "ExplicitDedication"
    },
    {
      "account": "admin",
      "dedicatedresources": [
        {
          "resourceid": "8928748b-cf9c-46df-b4c8-b39f476ebad3",
          "resourcename": "host-01",
          "resourcetype": "Host"
        }
      ],
      "description": "Dedicated host group",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "46fcaeee-ce9f-40a7-9314-68e338c84092",
      "name": "DedicatedHostGrp-admin",
      "type": "ExplicitDedication"
    }
  ],
  "count": 2
}

I created a custom affinity group for the admin account with the host-affinity type. Then, I called listAffinityGroups API for both admins and received the following outputs:

listAffinityGroups for admin
list affinitygroups 
{
  "affinitygroup": [
    {
      "account": "admin",
      "dedicatedresources": [
        {
          "resourceid": "8928748b-cf9c-46df-b4c8-b39f476ebad3",
          "resourcename": "host-01",
          "resourcetype": "Host"
        }
      ],
      "description": "Dedicated host group",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "4497ce7e-55d5-4dfe-a560-9d488f3ed038",
      "name": "DedicatedHostGrp-admin",
      "type": "ExplicitDedication"
    },
    {
      "account": "admin",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "70621909-06ae-4de2-b1f9-72a830c2c6ce",
      "name": "Low Latency Affinity Group",
      "type": "host affinity"
    }
  ],
  "count": 2
}
listAffinityGroups listall=true for admin
list affinitygroups listall=true
{
  "affinitygroup": [
    {
      "account": "admin2",
      "dedicatedresources": [
        {
          "resourceid": "8a783642-c6a0-4948-8128-61aa73aef8a9",
          "resourcename": "host-02",
          "resourcetype": "Host"
        }
      ],
      "description": "Dedicated host group",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "bfa1de1b-a81c-4c55-b763-f2672548c551",
      "name": "DedicatedHostGrp-admin2",
      "type": "ExplicitDedication"
    },
    {
      "account": "admin",
      "dedicatedresources": [
        {
          "resourceid": "8928748b-cf9c-46df-b4c8-b39f476ebad3",
          "resourcename": "host-01",
          "resourcetype": "Host"
        }
      ],
      "description": "Dedicated host group",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "4497ce7e-55d5-4dfe-a560-9d488f3ed038",
      "name": "DedicatedHostGrp-admin",
      "type": "ExplicitDedication"
    },
    {
      "account": "admin",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "70621909-06ae-4de2-b1f9-72a830c2c6ce",
      "name": "Low Latency Affinity Group",
      "type": "host affinity"
    }
  ],
  "count": 3
}
listAffinityGroups for admin2
list affinitygroups 
{
  "affinitygroup": [
    {
      "account": "admin2",
      "dedicatedresources": [
        {
          "resourceid": "8a783642-c6a0-4948-8128-61aa73aef8a9",
          "resourcename": "host-02",
          "resourcetype": "Host"
        }
      ],
      "description": "Dedicated host group",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "bfa1de1b-a81c-4c55-b763-f2672548c551",
      "name": "DedicatedHostGrp-admin2",
      "type": "ExplicitDedication"
    }
  ],
  "count": 1
}
listAffinityGroups listall=true for admin2
list affinitygroups listall=true
{
  "affinitygroup": [
    {
      "account": "admin2",
      "dedicatedresources": [
        {
          "resourceid": "8a783642-c6a0-4948-8128-61aa73aef8a9",
          "resourcename": "host-02",
          "resourcetype": "Host"
        }
      ],
      "description": "Dedicated host group",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "bfa1de1b-a81c-4c55-b763-f2672548c551",
      "name": "DedicatedHostGrp-admin2",
      "type": "ExplicitDedication"
    },
    {
      "account": "admin",
      "dedicatedresources": [
        {
          "resourceid": "8928748b-cf9c-46df-b4c8-b39f476ebad3",
          "resourcename": "host-01",
          "resourcetype": "Host"
        }
      ],
      "description": "Dedicated host group",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "4497ce7e-55d5-4dfe-a560-9d488f3ed038",
      "name": "DedicatedHostGrp-admin",
      "type": "ExplicitDedication"
    },
    {
      "account": "admin",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "70621909-06ae-4de2-b1f9-72a830c2c6ce",
      "name": "Low Latency Affinity Group",
      "type": "host affinity"
    }
  ],
  "count": 3
}

I released the host-02 dedication from admin2 and dedicated it to admin. Later, I dedicated the cluster cluster-zn-fln-01, which contains the hosts host-01 and host-02, to admin. CloudStack automatically created a new affinity group representing the cluster dedication and removed the affinity group related to the hosts dedications, since all hosts within the given cluster were already dedicated to the same account as the cluster.

listAffinityGroups for admin
list affinitygroups 
{
  "affinitygroup": [
    {
      "account": "admin",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "70621909-06ae-4de2-b1f9-72a830c2c6ce",
      "name": "Low Latency Affinity Group",
      "type": "host affinity"
    },
    {
      "account": "admin",
      "dedicatedresources": [
        {
          "resourceid": "d1050b75-b522-4371-9726-39b224e5d4c5",
          "resourcename": "Cluster-zn-fln-01",
          "resourcetype": "Cluster"
        }
      ],
      "description": "Dedicated cluster group",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "96bd929c-c622-4db0-a591-a91520f15b4c",
      "name": "DedicatedClusterGrp-admin",
      "type": "ExplicitDedication"
    }
  ],
  "count": 2
}

This behavior is consistent across all infrastructure resources. If the pod pod-zn-fln-01 is dedicated to admin, CloudStack will delete the cluster's affinity group and create a new one related to the pod.

listAffinityGroups for admin
list affinitygroups 
{
  "affinitygroup": [
    {
      "account": "admin",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "70621909-06ae-4de2-b1f9-72a830c2c6ce",
      "name": "Low Latency Affinity Group",
      "type": "host affinity"
    },
    {
      "account": "admin",
      "dedicatedresources": [
        {
          "resourceid": "007fe264-78a5-42b3-9523-7e77a593ae04",
          "resourcename": "Pod-zn-fln-01",
          "resourcetype": "Pod"
        }
      ],
      "description": "Dedicated pod group",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "7940435f-3ed5-4e43-8099-09ae6d65cebd",
      "name": "DedicatedPodGrp-admin",
      "type": "ExplicitDedication"
    }
  ],
  "count": 2
}

It's important to highlight that this PR does not change or affect any workflows related to resource dedications and affinity groups creation. It simply proposes to enhance the listAffinityGroups API response by adding the dedicatedresources field for root admins and by changing the default affinity groups' names and descriptions.

@DaanHoogland

Copy link
Copy Markdown
Contributor

ok @bernardodemarco , this means that listing will show the dedicated resources, even if the caller has no access to them, right?
(that was what I was asking)

@bernardodemarco

Copy link
Copy Markdown
Member Author

ok @bernardodemarco , this means that listing will show the dedicated resources, even if the caller has no access to them, right? (that was what I was asking)

Actually, in the provided test cases on #9188 (comment), the dedicatedresources field appeared because both users, admin and admin2, are root admins. The code validates whether the API caller is a root admin. Therefore, the dedicatedresources field will only be populated if the caller is a root admin.

Long callerId = CallContext.current().getCallingAccountId();
boolean isCallerRootAdmin = accountManager.isRootAdmin(callerId);
boolean containsDedicatedResources = vag.getType().equals("ExplicitDedication");
if (isCallerRootAdmin && containsDedicatedResources) {
List<DedicatedResourceVO> dedicatedResources = dedicatedResourceDao.listByAffinityGroupId(vag.getId());
this.populateDedicatedResourcesField(dedicatedResources, agResponse);
}


Here are some test cases, in the same environment as the previous tests, calling the listAffinityGroups API with a root admin and a normal user.

I created a user with the User role, called u1. Later, I dedicated host-01 to the admin account and host-02 to u1.

listAffinityGroups listall=true for admin
list affinitygroups listall=true
{
  "affinitygroup": [
    {
      "account": "admin",
      "dedicatedresources": [
        {
          "resourceid": "8928748b-cf9c-46df-b4c8-b39f476ebad3",
          "resourcename": "host-01",
          "resourcetype": "Host"
        }
      ],
      "description": "Dedicated host group",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "24b6aa85-b767-4f6e-841b-baf43460b7df",
      "name": "DedicatedHostGrp-admin",
      "type": "ExplicitDedication"
    },
    {
      "account": "u1",
      "dedicatedresources": [
        {
          "resourceid": "8a783642-c6a0-4948-8128-61aa73aef8a9",
          "resourcename": "host-02",
          "resourcetype": "Host"
        }
      ],
      "description": "Dedicated host group",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "780e66b8-71c1-4177-873e-2012763a1d9d",
      "name": "DedicatedHostGrp-u1",
      "type": "ExplicitDedication"
    }
  ],
  "count": 2
}
listAffinityGroups listall=true for u1
list affinitygroups listall=true
{
  "affinitygroup": [
    {
      "account": "u1",
      "description": "Dedicated host group",
      "domain": "ROOT",
      "domainid": "ba820fc7-12ea-11ef-9500-d283eea8b15e",
      "id": "780e66b8-71c1-4177-873e-2012763a1d9d",
      "name": "DedicatedHostGrp-u1",
      "type": "ExplicitDedication"
    }
  ],
  "count": 1
}

As can be noticed, the dedicatedresources field is not returned for the u1 call, since it is an account with the User role and does not have access to infrastructure resources. Additionally, here is the affinity groups UI for the user.

image

@DaanHoogland DaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

clgtm (i think there is something to be gained in refactorring the dedicate<Zone|Pod|Cluster|Host>() methods, but that is out of scope here.

@lucas-a-martins lucas-a-martins left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

In a local environment, I conducted the following tests:

Using a ROOT Admin, I dedicated a zone called zn-acs to the domain ROOT and admin account.
Using the listAffinityGroups API via CLI, I was able to list the new affinity group, including information about the dedicated resources.

CloudMonkey
(local) 🐱 > list affinitygroups
{
  "affinitygroup": [
    {
      "account": "admin",
      "dedicatedresources": [
        {
          "resourceid": "c869ab33-2d16-4ab4-928c-1378d54748ad",
          "resourcename": "zn-acs",
          "resourcetype": "Zone"
        }
      ],
      "description": "Dedicated zone group",
      "domain": "ROOT",
      "domainid": "f8065d27-38b0-11ef-8103-66e006a45a6c",
      "id": "b9d54958-3cc2-4f43-8852-d0d2950593c5",
      "name": "DedicatedZoneGrp-admin",
      "type": "ExplicitDedication"
    }
  ],
  "count": 1
}

The same information was available via UI:

Details on UI

Screenshot from 2024-07-23 15-33-38

I executed the listAffinityGroups API again, but this time using a second ROOT Admin (admin-test), and it didn't list any affinity group. I tried again using the listall=true parameter and it worked as intended. Through the UI, I had access to all affinity groups without needing an extra filter like the listall parameter.

CloudMonkey
(admin-test) 🐱 > list affinitygroups
(admin-test) 🐱 > list affinitygroups listall=true
{
  "affinitygroup": [
    {
      "account": "admin",
      "dedicatedresources": [
        {
          "resourceid": "c869ab33-2d16-4ab4-928c-1378d54748ad",
          "resourcename": "zn-acs",
          "resourcetype": "Zone"
        }
      ],
      "description": "Dedicated zone group",
      "domain": "ROOT",
      "domainid": "f8065d27-38b0-11ef-8103-66e006a45a6c",
      "id": "b9d54958-3cc2-4f43-8852-d0d2950593c5",
      "name": "DedicatedZoneGrp-admin",
      "type": "ExplicitDedication"
    }
  ],
  "count": 1
}

Using an account with the User role (test), I tried to list all affinity groups via CLI (with and without the listall=true parameter) and UI. In both cases, no affinity groups were listed.

I released the dedicated zone and dedicated it again to the domain ROOT, but this time without specifying an account.
Using the same User account, I tried to list the affinity groups again, and it worked as intended, showing no information about the dedicated resources.

CloudMonkey
(test) 🐱 > list affinitygroups
{
  "affinitygroup": [
    {
      "account": "system",
      "description": "Dedicated zone group",
      "domain": "ROOT",
      "domainid": "f8065d27-38b0-11ef-8103-66e006a45a6c",
      "id": "4196e123-8616-4688-b9bb-aeb786945c89",
      "name": "DedicatedZoneGrp-domain-ROOT",
      "type": "ExplicitDedication"
    }
  ],
  "count": 1
}
Details on UI for User account

Screenshot from 2024-07-23 15-39-53

@JoaoJandre

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@JoaoJandre a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

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

@JoaoJandre

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@JoaoJandre a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

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

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

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

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-11073)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 51352 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9188-t11073-kvm-ol8.zip
Smoke tests completed. 138 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_secure_vm_migration Error 135.48 test_vm_life_cycle.py
test_01_secure_vm_migration Error 135.48 test_vm_life_cycle.py

@github-actions

Copy link
Copy Markdown

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

@bernardodemarco

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@bernardodemarco a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

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

@bernardodemarco

Copy link
Copy Markdown
Member Author

@DaanHoogland, could we run the CI here?

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-11293)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 51971 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9188-t11293-kvm-ol8.zip
Smoke tests completed. 136 look OK, 3 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_DeployVmAffinityGroup Error 1.37 test_affinity_groups.py
test_01_non_strict_host_anti_affinity Error 3.64 test_nonstrict_affinity_group.py
test_02_non_strict_host_affinity Error 1.63 test_nonstrict_affinity_group.py
test_05_rvpc_multi_tiers Failure 491.58 test_vpc_redundant.py
test_05_rvpc_multi_tiers Error 491.60 test_vpc_redundant.py

@bernardodemarco

Copy link
Copy Markdown
Member Author

@blueorangutan test

Thanks, I'll check if these test errors are related to the PR's changes.

@bernardodemarco

Copy link
Copy Markdown
Member Author

I took a look at the marvin logs and, although the tests test_DeployVmAffinityGroup, test_01_non_strict_host_anti_affinity and test_02_non_strict_host_affinity are related to affinity groups, they do not seem to be related to the PR's changes. Apparently they're related to an incorrect SQL syntax. Here is the test_DeployVmAffinityGroup exception log:

2024-09-02 20:21:08,522 - CRITICAL - EXCEPTION: test_DeployVmAffinityGroup: ['Traceback (most recent call last):\n', '  File "/usr/lib64/python3.6/unittest/case.py", line 60, in testPartExecutor\n    yield\n', '  File "/usr/lib64/python3.6/unittest/case.py", line 622, in run\n    testMethod()\n', '  File "/marvin/tests/smoke/test_affinity_groups.py", line 183, in test_DeployVmAffinityGroup\n    affinitygroupnames=[self.affinity.name]\n', '  File "/usr/local/lib/python3.6/site-packages/marvin/lib/base.py", line 691, in create\n    virtual_machine = apiclient.deployVirtualMachine(cmd, method=method)\n', '  File "/usr/local/lib/python3.6/site-packages/marvin/cloudstackAPI/cloudstackAPIClient.py", line 4051, in deployVirtualMachine\n    response = self.connection.marvinRequest(command, response_type=response, method=method)\n', '  File "/usr/local/lib/python3.6/site-packages/marvin/cloudstackConnection.py", line 381, in marvinRequest\n    raise e\n', '  File "/usr/local/lib/python3.6/site-packages/marvin/cloudstackConnection.py", line 376, in marvinRequest\n    raise self.__lastError\n', '  File "/usr/local/lib/python3.6/site-packages/marvin/cloudstackConnection.py", line 105, in __poll\n    % async_response)\n', 'Exception: Job failed: {accountid : \'c6541c8f-6961-11ef-9f55-1e009f0003bc\', account : \'admin\', domainid : \'8da7e16b-6961-11ef-9f55-1e009f0003bc\', domainpath : \'ROOT\', userid : \'c654e153-6961-11ef-9f55-1e009f0003bc\', cmd : \'org.apache.cloudstack.api.command.admin.vm.DeployVMCmdByAdmin\', jobstatus : 2, jobprocstatus : 0, jobresultcode : 530, jobresulttype : \'object\', jobresult : {errorcode : 530, errortext : "Unable to find on DB, due to: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \')  FOR UPDATE\' at line 1"}, jobinstancetype : \'VirtualMachine\', jobinstanceid : \'76c4bd4b-5624-4b0f-837f-015948b82189\', created : \'2024-09-02T20:21:07+0000\', completed : \'2024-09-02T20:21:07+0000\', jobid : \'666bb04f-ec5c-4a45-b4fe-d2bc283c2755\'}\n']

These same erros also appeared on #9549 (comment). Furthermore, the pipeline was run previously (#9188 (comment)) and the errors were different.

Given that, @DaanHoogland could we run the CI again?

@DaanHoogland

Copy link
Copy Markdown
Contributor

We could @bernardodemarco , but given that @lucas-a-martins has done manual testing, he and I have reviewed and you have checked the regression test errors, I think we can spare the lab space and merge. cc @JoaoJandre ??

@DaanHoogland DaanHoogland added this to the 4.20.0.0 milestone Sep 10, 2024
@JoaoJandre JoaoJandre merged commit 6ec3c48 into apache:main Sep 10, 2024
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Sep 23, 2024
…s related to an affinity group (apache#9188)

* add dedicated resource response

* populate dedicatedresources field

* change affinity group name and description when it contains dedicated resources

* display dedicatedresources on UI

* add end of line to DedicatedResourceResponse class

* remove unnecessary fully qualified names
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.

5 participants