Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to deploy a capc cluster if there are templates present with the same name #386

Open
kiranchavala opened this issue Jul 3, 2024 · 1 comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@kiranchavala
Copy link
Contributor

/kind bug

What steps did you take and what happened:

  1. Register a template as admin user , provide the name as "ubuntu-2004-kube-v1.27.2-kvm"
  2. Create a normal user in cloudstack
  3. Login as normal user and register a template provide the same name "ubuntu-2004-kube-v1.27.2-kvm"
  4. Create Capc cluster with user credentials and mention the template name

export CLOUDSTACK_TEMPLATE_NAME=ubuntu-2004-kube-v1.27.2-kvm

  1. Capc cluster creation fails with the following exception
E0703 05:57:57.511717      14 controller.go:329]  "msg"="Reconciler error" "error"="1 error occurred:\n\t* expected 1 Template with name ubuntu-2004-kube-v1.27.2-kvm, but got 2\n\n" "CloudStackMachine"={"name":"capc-cluster-control-plane-wz57x","namespace":"default"} "controller"="cloudstackmachine" "controllerGroup"="infrastructure.cluster.x-k8s.io" "controllerKind"="CloudStackMachine" "name"="capc-cluster-control-plane-wz57x" "namespace"="default" "reconcileID"="9f2c304f-d233-46c3-995c-87fa22b9095a"

What did you expect to happen:

Capc Cluster should get created successfully

Expected behaviour
Anything else you would like to add:

When you execute the cloudstack list template API call with user credentials capc should give importance to the template which is registered by the user

https://cloudstack.apache.org/api/apidocs-4.19/apis/listTemplates.html

(cmk) list templates name=ubuntu-2004-kube-v1.27.2-kvm templatefilter=community account=ACSUser
{
  "count": 2,
  "template": [
    {
      "account": "admin",
      "bits": 0,
      "checksum": "e6a7d37d8b8c368bee63d6977f37328cbd6a2cc936a56ff55051fb9e9572053aca10807ebeb81e55e4eb2163d5a895c40e616e52a9d016af807661cb594998fe",
      "created": "2024-06-19T07:40:05+0000",
      "crossZones": true,
      "deployasis": false,
      "details": {
        "rootDiskController": "osdefault"
      },
      "directdownload": false,
      "displaytext": "ubuntu-2004-kube-v1.27.2-kvm",
      "domain": "ROOT",
      "domainid": "55144035-2e06-11ef-8b84-1e0078000175",
      "downloaddetails": [
        {
          "datastore": "nfs://10.0.32.4/acs/secondary/ref-trl-6871-k-M7-vishesh-jindal/ref-trl-6871-k-M7-vishesh-jindal-sec1",
          "downloadPercent": "100",
          "downloadState": "DOWNLOADED"
        },
        {
          "datastore": "ref-trl-6871-k-M7-vishesh-jindal-kvm-pri1",
          "downloadPercent": "100",
          "downloadState": "DOWNLOADED"
        },
        {
          "datastore": "ref-trl-6871-k-M7-vishesh-jindal-kvm-pri2",
          "downloadPercent": "100",
          "downloadState": "DOWNLOADED"
        }
      ],
      "format": "QCOW2",
      "hasannotations": false,
      "hypervisor": "KVM",
      "id": "1d5162ed-ee37-4354-ad38-f3563da93925",
      "isdynamicallyscalable": false,
      "isextractable": false,
      "isfeatured": false,
      "ispublic": true,
      "isready": true,
      "name": "ubuntu-2004-kube-v1.27.2-kvm",
      "ostypeid": "5531b910-2e06-11ef-8b84-1e0078000175",
      "ostypename": "Other Linux (64-bit)",
      "passwordenabled": false,
      "physicalsize": 4399300608,
      "requireshvm": true,
      "size": 21474836480,
      "sshkeyenabled": false,
      "tags": [],
      "templatetype": "USER",
      "zoneid": "52cfb5ce-e58e-40d0-a06f-c373dd86c2be",
      "zonename": "ref-trl-6871-k-M7-vishesh-jindal"
    },
    {
      "account": "ACSUser",
      "bits": 0,
      "checksum": "e6a7d37d8b8c368bee63d6977f37328cbd6a2cc936a56ff55051fb9e9572053aca10807ebeb81e55e4eb2163d5a895c40e616e52a9d016af807661cb594998fe",
      "created": "2024-07-03T05:28:31+0000",
      "crossZones": false,
      "deployasis": false,
      "details": {
        "rootDiskController": "osdefault"
      },
      "directdownload": false,
      "displaytext": "ubuntu-2004-kube-v1.27.2-kvm",
      "domain": "ROOT",
      "domainid": "55144035-2e06-11ef-8b84-1e0078000175",
      "downloaddetails": [
        {
          "datastore": "nfs://10.0.32.4/acs/secondary/ref-trl-6871-k-M7-vishesh-jindal/ref-trl-6871-k-M7-vishesh-jindal-sec1",
          "downloadPercent": "100",
          "downloadState": "DOWNLOADED"
        },
        {
          "datastore": "ref-trl-6871-k-M7-vishesh-jindal-kvm-pri2",
          "downloadPercent": "100",
          "downloadState": "DOWNLOADED"
        },
        {
          "datastore": "ref-trl-6871-k-M7-vishesh-jindal-kvm-pri1",
          "downloadPercent": "100",
          "downloadState": "DOWNLOADED"
        }
      ],
      "format": "QCOW2",
      "hasannotations": false,
      "hypervisor": "KVM",
      "id": "1e8297ed-3798-4eac-8ee2-f56687604a8f",
      "isdynamicallyscalable": false,
      "isextractable": false,
      "isfeatured": false,
      "ispublic": true,
      "isready": true,
      "name": "ubuntu-2004-kube-v1.27.2-kvm",
      "ostypeid": "55327b1c-2e06-11ef-8b84-1e0078000175",
      "ostypename": "Other (64-bit)",
      "passwordenabled": false,
      "physicalsize": 4399300608,
      "requireshvm": true,
      "size": 21474836480,
      "sshkeyenabled": false,
      "status": "Download Complete",
      "tags": [],
      "templatetype": "USER",
      "url": "http://10.0.3.130/capi/images/kvm/ubuntu-2004-kube-v1.27.2-kvm.qcow2.bz2",
      "zoneid": "52cfb5ce-e58e-40d0-a06f-c373dd86c2be",
      "zonename": "ref-trl-6871-k-M7-vishesh-jindal"
    }
  ]
}

Environment:

Cloudstack version : 4.19

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 3, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

3 participants