Skip to content

flasharray: skip hosts missing on the array and say so on attach - #14864

Open
Damans227 wants to merge 1 commit into
apache:4.22from
Damans227:flasharray-host-lookup
Open

Damans227 wants to merge 1 commit into
apache:4.22from
Damans227:flasharray-host-lookup

Conversation

@Damans227

Copy link
Copy Markdown
Collaborator

Fixes #14862
Fixes #14863

When a KVM host has no host object with the same name on the FlashArray, the host lookup crashes, which fails VM deployment outright, and attach fails with an error about revoking access that says nothing about the name. This makes the lookup return "not found" so the planner just skips that host, and attach now fails with a message that names the host and says the names must match.

  • getHost() returns null for an unknown host instead of crashing, and retries the short name only when the name has a domain part
  • attach fails with "Host [name] not found in FlashArray at [url]. The host object on the array must have the same name as the CloudStack host"
  • the attach fallback no longer crashes on a host name without a dot

Test:

Rename the array host object for one KVM host (purehost rename b08-36 b08-36-fc), then deploy a VM and attach a volume to a VM on that host.

Before: deploy crashes, attach error points at revoking access.

"errorcode": 530,
"errortext": "Cannot invoke \"...FlashArrayList.getItems()\" because \"list\" is null"

CloudRuntimeException: Error revoking access for host Host {"id":4,"name":"b08-36",...} to volume VolumeObject {...}

before-deploy
before-attach

After: deploy on that host fails cleanly, deploy without a host lands on the other host, attach says what is wrong.

== deploy on b08-36
"errortext": "No destination found for a deployment for VM instance ..."
== deploy any host
{"virtualmachine":{"hostname":"b08-35","state":"Running"}}

Host [b08-36] not found in FlashArray at [https://10.23.26.50:443/api]. The host object on the array must have the same name as the CloudStack host

after-deploy-attach
after-attach-message

Also added unit tests for the host lookup.

@codecov

codecov Bot commented Nov 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 4.08%. Comparing base (6489766) to head (8818e37).

❗ There is a different number of reports uploaded between BASE (6489766) and HEAD (8818e37). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (6489766) HEAD (8818e37)
unittests 1 0
Additional details and impacted files
@@              Coverage Diff              @@
##               4.22   #14864       +/-   ##
=============================================
- Coverage     18.34%    4.08%   -14.26%     
=============================================
  Files          5939      449     -5490     
  Lines        537819    38282   -499537     
  Branches      65941     7083    -58858     
=============================================
- Hits          98638     1564    -97074     
+ Misses       427960    36503   -391457     
+ Partials      11221      215    -11006     
Flag Coverage Δ
uitests 4.08% <ø> (ø)
unittests ?

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

☔ View full report in Codecov by Harness.
📢 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.

This branch has not been deployed

No deployments
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.

1 participant