Copilot commented on code in PR #13049:
URL: https://github.com/apache/cloudstack/pull/13049#discussion_r3153292749


##########
plugins/storage/volume/flasharray/src/main/java/org/apache/cloudstack/storage/datastore/adapter/flasharray/FlashArrayAdapter.java:
##########
@@ -200,28 +204,63 @@ public void detach(ProviderAdapterContext context, 
ProviderAdapterDataObject dat
 
     @Override
     public void delete(ProviderAdapterContext context, 
ProviderAdapterDataObject dataObject) {
-        // first make sure we are disconnected
-        removeVlunsAll(context, pod, dataObject.getExternalName());
         String fullName = normalizeName(pod, dataObject.getExternalName());
 
-        FlashArrayVolume volume = new FlashArrayVolume();
+        // Snapshots live under /volume-snapshots and already use the
+        // reserved form <volume>.<suffix>. FlashArray volume/snapshot names
+        // must match [A-Za-z0-9_-] and start/end with an alphanumeric, so
+        // appending our usual deletion-timestamp suffix to a snapshot name
+        // would produce a target like "<vol>.<n>-<ts>" - the embedded "."
+        // is rejected by the array. We therefore skip the rename for
+        // snapshots and only mark them destroyed; the array's own ".N"
+        // suffix already disambiguates them in the recycle bin.

Review Comment:
   The comment says FlashArray volume/snapshot names must match 
`[A-Za-z0-9_-]`, but snapshots on FlashArray inherently use the reserved 
`<volume>.<suffix>` form (with a `.`) and are valid on the `/volume-snapshots` 
endpoint. Consider rewording to clarify that the strict character rule applies 
to volume names / free-form renames, while snapshot names are reserved and 
cannot be renamed arbitrarily (hence skipping rename here).
   ```suggestion
           // Snapshots live under /volume-snapshots and already use the array's
           // reserved form <volume>.<suffix>, which legitimately contains ".".
           // The stricter [A-Za-z0-9_-] naming rule applies to regular volume
           // names and free-form rename targets, not to these reserved snapshot
           // names. Since FlashArray snapshot names are system-defined rather
           // than arbitrary rename targets, we skip the usual timestamped 
rename
           // and only mark snapshots destroyed; the array's own ".N" suffix
           // already disambiguates them in the recycle bin.
   ```



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

Reply via email to