Damans227 opened a new pull request, #14864:
URL: https://github.com/apache/cloudstack/pull/14864
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 {...}


**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


Also added unit tests for the host lookup.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]