Commit 618e00b
Eugenio Grosso
flasharray: fix delete() failing on snapshots due to invalid rename
ProviderAdapter.delete() is called for both volumes and snapshots; the
adapter treated every target as a volume and applied the same
rename-with-timestamp + destroy sequence. For snapshots this breaks
twice:
* FlashArray snapshots live at /volume-snapshots, not /volumes, so the
PATCH request was going to the wrong endpoint.
* The computed rename name (<volume>.<suffix>-<timestamp>) contains
a literal "." character, which violates the array name rules:
Volume name must be between 1 and 63 characters (alphanumeric,
_ and -), begin and end with a letter or number, and
include at least one letter, _, or -.
Every CloudStack-side snapshot delete therefore failed with a 400 from
the array, leaving orphan snapshots on both sides.
Branch early when the data object is a snapshot: issue a single PATCH
to /volume-snapshots with { destroyed: true } on the original name. No
rename; the suffix the array assigns (e.g. ".1") already encodes the
ordering and we cannot safely append anything to it. The 24h recycle
bin still applies, so operators can recover a snapshot from the array
within the retention window.1 parent 139ca0c commit 618e00b
1 file changed
Lines changed: 22 additions & 1 deletion
File tree
- plugins/storage/volume/flasharray/src/main/java/org/apache/cloudstack/storage/datastore/adapter/flasharray
Lines changed: 22 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
203 | 225 | | |
204 | 226 | | |
205 | | - | |
206 | 227 | | |
207 | 228 | | |
208 | 229 | | |
| |||
0 commit comments