Skip to content

server: fix templatetype during iso upload#12151

Open
shwstppr wants to merge 2 commits intoapache:4.22from
shapeblue:fix-isoup-tmpltype
Open

server: fix templatetype during iso upload#12151
shwstppr wants to merge 2 commits intoapache:4.22from
shapeblue:fix-isoup-tmpltype

Conversation

@shwstppr
Copy link
Contributor

@shwstppr shwstppr commented Nov 27, 2025

Description

Fixes #12104

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

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

(test) 🐱 > get uploadparamsforiso  zoneid=dc5ac4bd-b1bd-4b3d-8d3a-c371897163c4 (pr12151-t14874-kvm-ol8) name=test  bootable=true ostypeid=4d02db28-cb86-11f0-9397-1e00d5000394 (Other Linux (64-bit)) filepath=/home/shwstppr/www/html/files/Template-ISO/TinyCore-8.0.iso format=ISO
{
  "getuploadparams": {
    "expires": "2025-11-27T20:17:37.743Z",
    "id": "f7f9cc6e-ca23-46b2-b51c-412c02fcf686",
    "metadata": "J6e+Y/fw5j29+6H4g1CiC+9v9XeBfACB89ugQb+5QepU20/Ugp9Dwf17AiZn3SMs7+42jYTMZDX8A3bIox953syD97kXBwx6G2Iki5IsznCXn0WMoykXqJD+Q/nvjb33Hv27qOCRisPLS2Z0gp+ceIkoKbhI3lJspoQ4KaUjLepT/2wUi+ErDPO/u4xQS2ps40ARPKei75P+F1ENFvb2KY3z32CcjV5S4Lzy2cIy49/KJE+/71q1FuKONldm+79Q4cMloInXXRSWDT1Jp6AlmvmXi8th54LsDgjCPje/PR9cy7WTcC6+9meDV+2wazKSCDzWN2hYZ3jBh+n71QOXpm7wfvRbgj3PzZFKREqo9iHbvr7JFPCp8ytCwmeT9ou90XrZY/YbObvoPXF9K4ZcS2rQ8PalfVx6OxByL3wIR2tjotSidVRxY9BvDUcPsuPwO9MJ9kt94kwizlbnbP1hxu/Ap3/XXgBjA53pb5LyEYTF+rnuemwCIwJuvgjUs+ZW4As1C2a7u0MTK6Z6/teU7KNRUn3TUCT3PMrKDcgQE8BZym3InC63Y87UfuXxIYG2BWmrQVOHl8ZKF7Vc/OSCCJhZx6Xhpc5FIte/kizp3zRSjB8/kAjEdmQR1XLiS6+Q8BO8TuNt7ZoIDUVtvs+fF7M=",
    "postURL": "http://10.0.53.101/upload/f7f9cc6e-ca23-46b2-b51c-412c02fcf686",
    "signature": "GHMt4362nI/t5tSPaPQl2hzwNTg="
  }
}
Uploading files for getUploadParamsForIso : [/home/shwstppr/www/html/files/Template-ISO/TinyCore-8.0.iso]
[1/1] TinyCore-8.0.iso	[========================] ✅
All files uploaded successfully.
(test) 🐱 > list isos isofilter=self id=f7f9cc6e-ca23-46b2-b51c-412c02fcf686
{
  "count": 1,
  "iso": [
    {
      "account": "admin",
      "arch": "x86_64",
      "bits": 64,
      "bootable": true,
      "created": "2025-11-27T19:17:37+0000",
      "crossZones": false,
      "directdownload": false,
      "displaytext": "test",
      "domain": "ROOT",
      "domainid": "4cdc2592-cb86-11f0-9397-1e00d5000394",
      "domainpath": "ROOT",
      "downloaddetails": [
        {
          "datastore": "pr12151-t14874-kvm-ol8-sec1",
          "datastoreId": "d00fd22e-bc60-4645-8505-dc2e016fc606",
          "datastoreRole": "Image",
          "downloadPercent": "100",
          "downloadState": "DOWNLOADED"
        }
      ],
      "format": "ISO",
      "hasannotations": false,
      "id": "f7f9cc6e-ca23-46b2-b51c-412c02fcf686",
      "isdynamicallyscalable": false,
      "isextractable": false,
      "isfeatured": false,
      "ispublic": false,
      "isready": true,
      "name": "test",
      "ostypeid": "4d02db28-cb86-11f0-9397-1e00d5000394",
      "ostypename": "Other Linux (64-bit)",
      "passwordenabled": false,
      "physicalsize": 16777216,
      "size": 16777216,
      "status": "Successfully Installed",
      "tags": [],
      "zoneid": "dc5ac4bd-b1bd-4b3d-8d3a-c371897163c4",
      "zonename": "pr12151-t14874-kvm-ol8"
    }
  ]
}

In DB,

mysql> select id,name,type from vm_template where uuid='f7f9cc6e-ca23-46b2-b51c-412c02fcf686'\G
*************************** 1. row ***************************
  id: 202
name: test
type: USER
1 row in set (0.01 sec)

VM deployment,

(test) 🐱 > deploy virtualmachine zoneid=dc5ac4bd-b1bd-4b3d-8d3a-c371897163c4 (pr12151-t14874-kvm-ol8)  serviceofferingid=c3ccc089-5b66-4211-97b4-06eb2609f106 (Small Instance) diskofferingid=5607ab76-127d-4fa9-9001-1262d15e3c68 (Small) templateid=f7f9cc6e-ca23-46b2-b51c-412c02fcf686 hypervisor=KVM
{
  "virtualmachine": {
    "account": "admin",
    "affinitygroup": [],
    "arch": "x86_64",
    "cpunumber": 1,
    "cpuspeed": 500,
    "created": "2025-11-27T19:23:29+0000",
    "deleteprotection": false,
    "details": {
      "cpuOvercommitRatio": "2.0",
      "rootdisksize": "5"
    },
    "diskofferingid": "5607ab76-127d-4fa9-9001-1262d15e3c68",
    "diskofferingname": "Small",
    "displayname": "VM-e12cdbe2-01b1-496f-ae5b-438d6466c3cf",
    "displayvm": true,
    "domain": "ROOT",
    "domainid": "4cdc2592-cb86-11f0-9397-1e00d5000394",
    "domainpath": "ROOT",
    "guestosid": "4d02db28-cb86-11f0-9397-1e00d5000394",
    "haenable": false,
    "hasannotations": false,
    "hostcontrolstate": "Enabled",
    "hostid": "23417a35-afff-4223-a7d3-4963dcecb609",
    "hostname": "pr12151-t14874-kvm-ol8-kvm1",
    "hypervisor": "KVM",
    "id": "e12cdbe2-01b1-496f-ae5b-438d6466c3cf",
    "instancename": "i-2-4-VM",
    "ipaddress": "10.1.1.156",
    "isdynamicallyscalable": false,
    "isodisplaytext": "test",
    "isoid": "f7f9cc6e-ca23-46b2-b51c-412c02fcf686",
    "isoname": "test",
    "jobid": "7bbff84c-a725-4fb1-8a82-1fed17095b86",
    "jobstatus": 0,
    "lastupdated": "2025-11-27T19:24:26+0000",
    "memory": 512,
    "name": "VM-e12cdbe2-01b1-496f-ae5b-438d6466c3cf",
    "nic": [
      {
        "broadcasturi": "vlan://1374",
        "deviceid": "0",
        "extradhcpoption": [],
        "gateway": "10.1.1.1",
        "id": "e6aa46e8-17e8-49b1-a9dd-0e8cece77a39",
        "ipaddress": "10.1.1.156",
        "isdefault": true,
        "isolationuri": "vlan://1374",
        "macaddress": "02:01:00:cc:00:01",
        "netmask": "255.255.255.0",
        "networkid": "8585e092-031d-4754-8bc7-335249ea2e2d",
        "networkname": "admin-network",
        "secondaryip": [],
        "traffictype": "Guest",
        "type": "Isolated"
      }
    ],
    "osdisplayname": "Other Linux (64-bit)",
    "ostypeid": "4d02db28-cb86-11f0-9397-1e00d5000394",
    "passwordenabled": false,
    "pooltype": "NetworkFilesystem",
    "receivedbytes": 0,
    "rootdeviceid": 0,
    "rootdevicetype": "ROOT",
    "securitygroup": [],
    "sentbytes": 0,
    "serviceofferingid": "c3ccc089-5b66-4211-97b4-06eb2609f106",
    "serviceofferingname": "Small Instance",
    "state": "Running",
    "tags": [],
    "templatedisplaytext": "test",
    "templateformat": "ISO",
    "templateid": "f7f9cc6e-ca23-46b2-b51c-412c02fcf686",
    "templatename": "test",
    "templatetype": "USER",
    "userid": "b6230f1b-cb86-11f0-9397-1e00d5000394",
    "username": "admin",
    "zoneid": "dc5ac4bd-b1bd-4b3d-8d3a-c371897163c4",
    "zonename": "pr12151-t14874-kvm-ol8"
  }
}

How did you try to break this feature and the system with this change?

Fixes apache#12104

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr shwstppr changed the base branch from main to 4.22 November 27, 2025 06:00
@codecov
Copy link

codecov bot commented Nov 27, 2025

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.40%. Comparing base (671d8ad) to head (cc8030f).
⚠️ Report is 208 commits behind head on 4.22.

Files with missing lines Patch % Lines
...n/java/com/cloud/template/TemplateManagerImpl.java 0.00% 2 Missing and 1 partial ⚠️
.../src/main/java/com/cloud/vm/UserVmManagerImpl.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.22   #12151      +/-   ##
============================================
+ Coverage     17.55%   18.40%   +0.84%     
- Complexity    15536    16716    +1180     
============================================
  Files          5909     5918       +9     
  Lines        529118   561460   +32342     
  Branches      64627    77672   +13045     
============================================
+ Hits          92902   103323   +10421     
- Misses       425761   447047   +21286     
- Partials      10455    11090     +635     
Flag Coverage Δ
uitests 4.42% <ø> (+0.84%) ⬆️
unittests 19.48% <0.00%> (+0.86%) ⬆️

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.

@shwstppr shwstppr closed this Nov 27, 2025
@shwstppr shwstppr reopened this Nov 27, 2025
@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@shwstppr 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

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

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@shwstppr 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.

Copy link
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

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

code lgtm

not tested yet

@blueorangutan
Copy link

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

@shwstppr shwstppr marked this pull request as ready for review November 27, 2025 19:25
@shwstppr
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-14878)

@weizhouapache weizhouapache added this to the 4.22.1 milestone Feb 4, 2026
Copy link
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

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

code lgtm

@weizhouapache
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache 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

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

@weizhouapache
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache 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

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

@shwstppr shwstppr closed this Feb 9, 2026
@shwstppr shwstppr reopened this Feb 9, 2026
Copy link
Collaborator

@sudo87 sudo87 left a comment

Choose a reason for hiding this comment

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

clgtm

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.

clgtm

@nvazquez
Copy link
Contributor

@blueorangutan test

Copy link
Contributor

@nvazquez nvazquez left a comment

Choose a reason for hiding this comment

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

Code LGTM - haven't tested it

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

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

[Cloudstack 4.22] Bug when importing ISO – template_type remains NULL in database

8 participants