You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "andrijapanicsb (via GitHub)" <gi...@apache.org> on 2026/05/28 01:43:57 UTC

[PR] Improve VMware import guest OS detection [cloudstack]

andrijapanicsb opened a new pull request, #13269:
URL: https://github.com/apache/cloudstack/pull/13269

   ### Summary
   - Prefer the VMware Tools/display OS name when resolving guest OS mappings for VMware-to-KVM imports.
   - Preserve the existing VMware guest OS identifier lookup as the compatibility fallback.
   - Retry mapping lookups without the source hypervisor version, then fall back to a strong CloudStack OS type match before leaving the default behavior in place.
   - Apply the same guest OS resolution server-side when `osid` is not supplied.
   
   ### Testing
   - `mvn -pl server -am -Dtest=UnmanagedVMsManagerImplTest -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false test`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Improve VMware import guest OS detection [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13269:
URL: https://github.com/apache/cloudstack/pull/13269#issuecomment-4569304644

   <b>[SF] Trillian test result (tid-16213)</b>
   Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
   Total time taken: 52011 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr13269-t16213-kvm-ol8.zip
   Smoke tests completed. 151 look OK, 0 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Improve VMware import guest OS detection [cloudstack]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13269:
URL: https://github.com/apache/cloudstack/pull/13269#issuecomment-5812961622

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Improve VMware import guest OS detection [cloudstack]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #13269:
URL: https://github.com/apache/cloudstack/pull/13269#issuecomment-4560167047

   ## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/13269?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 3.51%. Comparing base ([`c0ce5b4`](https://app.codecov.io/gh/apache/cloudstack/commit/c0ce5b461f816bd6a6c1ceee8c1ee3104b3dbde7?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`d28460f`](https://app.codecov.io/gh/apache/cloudstack/commit/d28460f70851609d782f2f5bfc8b7d8c31a854e4?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   > :exclamation:  There is a different number of reports uploaded between BASE (c0ce5b4) and HEAD (d28460f). Click for more details.
   > 
   > <details><summary>HEAD has 1 upload less than BASE</summary>
   >
   >| Flag | BASE (c0ce5b4) | HEAD (d28460f) |
   >|------|------|------|
   >|unittests|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              Coverage Diff              @@
   ##               main   #13269       +/-   ##
   =============================================
   - Coverage     18.10%    3.51%   -14.59%     
   =============================================
     Files          6037      464     -5573     
     Lines        542796    40189   -502607     
     Branches      66456     7574    -58882     
   =============================================
   - Hits          98268     1413    -96855     
   + Misses       433492    38586   -394906     
   + Partials      11036      190    -10846     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/13269/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/13269/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `3.51% <ø> (-0.01%)` | :arrow_down: |
   | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/13269/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/cloudstack/pull/13269?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Improve VMware import guest OS detection [cloudstack]

Posted by "andrijapanicsb (via GitHub)" <gi...@apache.org>.
andrijapanicsb commented on PR #13269:
URL: https://github.com/apache/cloudstack/pull/13269#issuecomment-4561897055

   @blueorangutan package kvm


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Improve VMware import guest OS detection [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13269:
URL: https://github.com/apache/cloudstack/pull/13269#issuecomment-4562274187

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Improve VMware import guest OS detection [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13269:
URL: https://github.com/apache/cloudstack/pull/13269#issuecomment-4561908247

   @andrijapanicsb a [SL] Jenkins job has been kicked to build packages. It will be bundled with kvm SystemVM template(s). I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Improve VMware import guest OS detection [cloudstack]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13269:
URL: https://github.com/apache/cloudstack/pull/13269#issuecomment-6176283127

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Improve VMware import guest OS detection [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13269:
URL: https://github.com/apache/cloudstack/pull/13269#issuecomment-4562257610

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Improve VMware import guest OS detection [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #13269:
URL: https://github.com/apache/cloudstack/pull/13269#issuecomment-5068812848

   @nvazquez @kiranchavala , can you please look at this one? I see no issues with-it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Improve VMware import guest OS detection [cloudstack]

Posted by "andrijapanicsb (via GitHub)" <gi...@apache.org>.
andrijapanicsb commented on PR #13269:
URL: https://github.com/apache/cloudstack/pull/13269#issuecomment-4562262321

   @blueorangutan test keepEnv


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Improve VMware import guest OS detection [cloudstack]

Posted by "shwstppr (via GitHub)" <gi...@apache.org>.
shwstppr commented on code in PR #13269:
URL: https://github.com/apache/cloudstack/pull/13269#discussion_r3812500890


##########
ui/src/views/tools/ManageInstances.vue:
##########
@@ -1379,18 +1379,121 @@ export default {
         this.fetchInstances()
       }
     },
-    async fetchGuestOsMappings (osIdentifier, hypervisorVersion) {
-      const params = {}
-      params.hypervisor = 'VMware'
-      params.hypervisorversion = hypervisorVersion
-      params.osnameforhypervisor = osIdentifier
+    async fetchGuestOsMappingsByParams (params) {
       return await getAPI('listGuestOsMapping', params).then(json => {
         return json.listguestosmappingresponse?.guestosmapping || []
       }).catch(error => {
         this.$notifyError(error)
         return []
       })
     },
+    normalizeGuestOsName (name) {
+      return (name || '')
+        .toLowerCase()
+        .replace(/^microsoft\s+/, '')
+        .replace(/[^a-z0-9]+/g, ' ')
+        .replace(/\s+/g, ' ')
+        .trim()
+    },
+    isStrongGuestOsNameMatch (osType, osDisplayName) {
+      const candidate = this.normalizeGuestOsName(osType.description || osType.osdisplayname)
+      const source = this.normalizeGuestOsName(osDisplayName)
+      if (!candidate || !source) {
+        return false
+      }
+      if (candidate === source) {
+        return true
+      }
+      if (Math.min(candidate.length, source.length) < 8) {
+        return false
+      }
+      return candidate.includes(source) || source.includes(candidate)
+    },
+    async fetchGuestOsTypeFallbackMappings (osDisplayName) {
+      if (!osDisplayName || !('listOsTypes' in this.$store.getters.apis)) {
+        return []
+      }
+      return await getAPI('listOsTypes', {
+        description: osDisplayName
+      }).then(json => {
+        const osTypes = json.listostypesresponse?.ostype || []
+        return osTypes
+          .filter(osType => this.isStrongGuestOsNameMatch(osType, osDisplayName))
+          .map(osType => {
+            return {
+              ostypeid: osType.id,
+              osdisplayname: osType.description || osType.osdisplayname
+            }
+          })
+      }).catch(error => {
+        this.$notifyError(error)
+        return []
+      })
+    },
+    filterGuestOsMappings (mappings, params, osDisplayName) {
+      if (!mappings || mappings.length === 0) {
+        return []
+      }
+
+      const osNameForHypervisor = (params.osnameforhypervisor || '').toLowerCase()
+      let filteredMappings = mappings
+      if (osNameForHypervisor) {
+        filteredMappings = mappings.filter(mapping => (mapping.osnameforhypervisor || '').toLowerCase() === osNameForHypervisor)
+      }
+
+      if (osDisplayName) {
+        const displayNameMatches = filteredMappings.filter(mapping => this.isStrongGuestOsNameMatch(mapping, osDisplayName))
+        if (displayNameMatches.length > 0) {
+          return displayNameMatches
+        }
+        if (params.osdisplayname) {
+          return []
+        }
+      }
+
+      return filteredMappings
+    },
+    async fetchGuestOsMappings (osIdentifier, osDisplayName, hypervisorVersion) {
+      const lookups = []
+      if (osIdentifier) {
+        lookups.push({
+          hypervisor: 'VMware',
+          hypervisorversion: hypervisorVersion,
+          osnameforhypervisor: osIdentifier
+        })
+      }
+      if (osIdentifier) {
+        lookups.push({
+          hypervisor: 'VMware',
+          osnameforhypervisor: osIdentifier
+        })
+      }
+      if (osDisplayName) {
+        lookups.push({
+          hypervisor: 'VMware',
+          hypervisorversion: hypervisorVersion,
+          osdisplayname: osDisplayName
+        })
+      }
+      if (osDisplayName) {
+        lookups.push({
+          hypervisor: 'VMware',
+          osdisplayname: osDisplayName
+        })
+      }

Review Comment:
   maybe this can be refactored. As I understand we want 2 looksups for each type - one with version and one without



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Improve VMware import guest OS detection [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #13269:
URL: https://github.com/apache/cloudstack/pull/13269#issuecomment-5358523054

   @nvazquez can you have a look as well?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org