This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit cfb4d4378f296c72c7e2ed8f16ee9c90c0b0c804
Merge: 4de2f38cd13 a1f547a0110
Author: Rohit Yadav <rohit.ya...@shapeblue.com>
AuthorDate: Fri Feb 9 00:13:23 2024 +0530

    Merge remote-tracking branch 'origin/4.19'
    
    Signed-off-by: Rohit Yadav <rohit.ya...@shapeblue.com>

 .../kvm/storage/LinstorStorageAdaptor.java         | 31 +++++----
 .../driver/StorPoolPrimaryDataStoreDriver.java     | 16 ++++-
 .../storage/datastore/util/StorPoolUtil.java       |  9 ++-
 .../snapshot/StorPoolVMSnapshotStrategy.java       |  2 +-
 .../plugins/storpool/TestTagsOnStorPool.py         | 75 +++++++++++++++++-----
 tools/marvin/marvin/lib/base.py                    |  6 +-
 6 files changed, 106 insertions(+), 33 deletions(-)

diff --cc 
plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java
index 7739be83845,3124d61f5f1..b54713ede5f
--- 
a/plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java
+++ 
b/plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java
@@@ -289,14 -292,14 +297,14 @@@ public class LinstorStorageAdaptor impl
              Properties props = new Properties();
              props.put("DrbdOptions/Net/allow-two-primaries", "yes");
              rdm.setOverrideProps(props);
-             answers = api.resourceDefinitionModify(rscName, rdm);
+             ApiCallRcList answers = api.resourceDefinitionModify(rscName, 
rdm);
              if (answers.hasError()) {
 -                s_logger.error("Unable to set 'allow-two-primaries' on " + 
rscName);
 +                logger.error("Unable to set 'allow-two-primaries' on " + 
rscName);
-                 throw new CloudRuntimeException(answers.get(0).getMessage());
+                 // do not fail here as adding allow-two-primaries property is 
only a problem while live migrating
              }
          } catch (ApiException apiEx) {
 -            s_logger.error(apiEx);
 +            logger.error(apiEx);
-             throw new CloudRuntimeException(apiEx.getBestMessage(), apiEx);
+             // do not fail here as adding allow-two-primaries property is 
only a problem while live migrating
          }
          return true;
      }
@@@ -358,21 -361,23 +366,22 @@@
                      ResourceDefinitionModify rdm = new 
ResourceDefinitionModify();
                      
rdm.deleteProps(Collections.singletonList("DrbdOptions/Net/allow-two-primaries"));
                      ApiCallRcList answers = 
api.resourceDefinitionModify(rsc.get().getName(), rdm);
--                    if (answers.hasError())
--                    {
-                         logger.error("Failed to remove 'allow-two-primaries' 
on " + rsc.get().getName());
-                         throw new 
CloudRuntimeException(answers.get(0).getMessage());
 -                        s_logger.error(
++                    if (answers.hasError()) {
++                        logger.error(
+                                 String.format("Failed to remove 
'allow-two-primaries' on %s: %s",
+                                         rsc.get().getName(), 
LinstorUtil.getBestErrorMessage(answers)));
+                         // do not fail here as removing allow-two-primaries 
property isn't fatal
                      }
  
                      return true;
                  }
 -                s_logger.warn("Linstor: Couldn't find resource for this path: 
" + localPath);
 +                logger.warn("Linstor: Couldn't find resource for this path: " 
+ localPath);
              } catch (ApiException apiEx) {
-                 logger.error(apiEx);
-                 throw new CloudRuntimeException(apiEx.getBestMessage(), 
apiEx);
 -                s_logger.error(apiEx.getBestMessage());
++                logger.error(apiEx.getBestMessage());
+                 // do not fail here as removing allow-two-primaries property 
isn't fatal
              }
          }
-         return false;
+         return true;
      }
  
      @Override
diff --cc 
plugins/storage/volume/storpool/src/main/java/org/apache/cloudstack/storage/datastore/driver/StorPoolPrimaryDataStoreDriver.java
index 32f1fa7bd11,08a3252d869..f7e643ca62b
--- 
a/plugins/storage/volume/storpool/src/main/java/org/apache/cloudstack/storage/datastore/driver/StorPoolPrimaryDataStoreDriver.java
+++ 
b/plugins/storage/volume/storpool/src/main/java/org/apache/cloudstack/storage/datastore/driver/StorPoolPrimaryDataStoreDriver.java
@@@ -1134,12 -1145,12 +1146,12 @@@ public class StorPoolPrimaryDataStoreDr
                  SpConnectionDesc conn = 
StorPoolUtil.getSpConnection(poolVO.getUuid(), poolVO.getId(), 
storagePoolDetailsDao, primaryStoreDao);
                  String volName = 
StorPoolStorageAdaptor.getVolumeNameFromPath(volume.getPath(), true);
                  VMInstanceVO userVM = vmInstanceDao.findById(vmId);
-                 SpApiResponse resp = StorPoolUtil.volumeUpdateTags(volName, 
volume.getInstanceId() != null ? userVM.getUuid() : "", null, conn, 
getVcPolicyTag(vmId));
+                 SpApiResponse resp = 
StorPoolUtil.volumeUpdateIopsAndTags(volName, volume.getInstanceId() != null ? 
userVM.getUuid() : "", null, conn, getVcPolicyTag(vmId));
                  if (resp.getError() != null) {
 -                    log.warn(String.format("Could not update VC policy tags 
of a volume with id [%s]", volume.getUuid()));
 +                    logger.warn(String.format("Could not update VC policy 
tags of a volume with id [%s]", volume.getUuid()));
                  }
              } catch (Exception e) {
 -                log.warn(String.format("Could not update Virtual machine tags 
due to %s", e.getMessage()));
 +                logger.warn(String.format("Could not update Virtual machine 
tags due to %s", e.getMessage()));
              }
          }
      }

Reply via email to