You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "GutoVeronezi (via GitHub)" <gi...@apache.org> on 2023/09/15 03:06:11 UTC

[GitHub] [cloudstack] GutoVeronezi commented on a diff in pull request #7964: Allow configkey to set 'cloud-name' cloud-init metadata

GutoVeronezi commented on code in PR #7964:
URL: https://github.com/apache/cloudstack/pull/7964#discussion_r1326731382


##########
server/src/main/java/com/cloud/network/NetworkModelImpl.java:
##########
@@ -2673,6 +2673,11 @@ public List<String[]> generateVmData(String userData, String userDataDetails, St
             vmData.add(new String[]{METATDATA_DIR, CLOUD_DOMAIN_ID_FILE, domain.getUuid()});
         }
 
+        String customCloudName = VirtualMachineManager.CloudInitMetadataCloudName.valueIn(datacenterId);
+        if (!StringUtils.isBlank(customCloudName)) {

Review Comment:
   ```suggestion
           if (StringUtils.isNotBlank(customCloudName)) {
   ```



##########
engine/api/src/main/java/com/cloud/vm/VirtualMachineManager.java:
##########
@@ -83,6 +83,9 @@ public interface VirtualMachineManager extends Manager {
     ConfigKey<Boolean> AllowExposeDomainInMetadata = new ConfigKey<>("Advanced", Boolean.class, "metadata.allow.expose.domain",
             "false", "If set to true, it allows the VM's domain to be seen in metadata.", true, ConfigKey.Scope.Domain);
 
+    ConfigKey<String> CloudInitMetadataCloudName = new ConfigKey<>("Advanced", String.class, "metadata.custom.cloud.name", "",

Review Comment:
   ```suggestion
       ConfigKey<String> MetadataCustomCloudName = new ConfigKey<>("Advanced", String.class, "metadata.custom.cloud.name", "",
   ```



##########
server/src/main/java/com/cloud/network/router/CommandSetupHelper.java:
##########
@@ -231,6 +231,11 @@ public void createVmDataCommand(final VirtualRouter router, final UserVm vm, fin
                 vmDataCommand.addVmData(NetworkModel.METATDATA_DIR, NetworkModel.CLOUD_DOMAIN_ID_FILE, domain.getUuid());
             }
 
+            String customCloudName = VirtualMachineManager.CloudInitMetadataCloudName.valueIn(vm.getDataCenterId());
+            if (!StringUtils.isBlank(customCloudName)) {

Review Comment:
   ```suggestion
               if (StringUtils.isNotBlank(customCloudName)) {
   ```



-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org