[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-10261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16355954#comment-16355954
 ] 

ASF GitHub Bot commented on CLOUDSTACK-10261:
---------------------------------------------

DaanHoogland closed pull request #2441: CLOUDSTACK-10261: Libvirt metadata: 
only create one nuage-extension tag
URL: https://github.com/apache/cloudstack/pull/2441
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
 
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
index 385fe79ef2a..90674eb99a8 100644
--- 
a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
+++ 
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
@@ -1543,16 +1543,15 @@ public void addNuageExtension(String macAddress, String 
vrIp) {
         @Override
         public String toString() {
             StringBuilder fsBuilder = new StringBuilder();
+            fsBuilder.append("<nuage-extension 
xmlns='nuagenetworks.net/nuage/cna'>\n");
             for (Map.Entry<String, String> address : addresses.entrySet()) {
-                fsBuilder.append("<nuage-extension 
xmlns='nuagenetworks.net/nuage/cna'>\n")
-                        .append("  <interface mac='")
-                        .append(address.getKey())
-                        .append("' vsp-vr-ip='")
-                        .append(address.getValue())
-                        .append("'></interface>\n")
-                        .append("</nuage-extension>\n");
+                fsBuilder.append("  <interface mac='")
+                         .append(address.getKey())
+                         .append("' vsp-vr-ip='")
+                         .append(address.getValue())
+                         .append("'></interface>\n");
             }
-            return fsBuilder.toString();
+            return fsBuilder.append("</nuage-extension>\n").toString();
         }
     }
 
diff --git 
a/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtVMDefTest.java
 
b/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtVMDefTest.java
index 006562c213e..b391b94e740 100644
--- 
a/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtVMDefTest.java
+++ 
b/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtVMDefTest.java
@@ -209,4 +209,21 @@ public void testSCSIDef() {
         assertEquals(str, expected);
     }
 
+    public void testMetadataDef() {
+        LibvirtVMDef.MetadataDef metadataDef = new LibvirtVMDef.MetadataDef();
+
+        
metadataDef.getMetadataNode(LibvirtVMDef.NuageExtensionDef.class).addNuageExtension("mac1",
 "ip1");
+        
metadataDef.getMetadataNode(LibvirtVMDef.NuageExtensionDef.class).addNuageExtension("mac2",
 "ip2");
+
+        String xmlDef = metadataDef.toString();
+        String expectedXml = "<metadata>\n" +
+                "<nuage-extension xmlns='nuagenetworks.net/nuage/cna'>\n" +
+                "  <interface mac='mac2' vsp-vr-ip='ip2'></interface>\n" +
+                "  <interface mac='mac1' vsp-vr-ip='ip1'></interface>\n" +
+                "</nuage-extension>\n" +
+                "</metadata>\n";
+
+        assertEquals(xmlDef, expectedXml);
+    }
+
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Nuage: Multinic: Libvirt nuage-extenstion metadata contains only one 
> interface.
> -------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-10261
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10261
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>          Components: cloudstack-agent
>    Affects Versions: 4.11.0.0
>         Environment: Nuage VSP plugin on RHEL 7.4
>            Reporter: Frank Maximus
>            Assignee: Frank Maximus
>            Priority: Critical
>             Fix For: 4.11.0.0
>
>
> When installed ACS 4.11 on top of Rhel7.4 baseimage with libvirt-3.2.0 ,there 
> is an issue with the metadata of the created VM in cloudstack. 
> It leads to password reset failure as the nuage vrs is not allowing passage 
> to DomainRouter.
> After debugging , it was found that the nuage-extension in metadata was 
> missing.
> When cloudstack-agent is preparing xml to be sent to openvswitch it contains 
> metadata with nuage-extension block as follows
> <metadata>
> <nuage-extension>
> <interface mac='02:00:6c:fb:00:03' vsp-vr-ip='10.1.0.2'></interface>
> </nuage-extension>
> </metadata>
> In /var/log/openvswitch/vm-monitor.log , the received XML of VM is without 
> nuage-extension block in metadata as follows:
> Jan 15 18:17:17 ovs-1 vm-monitor.log: <metadata/>
> So the metadata block is now empty. It seems libvirt 3.2.0 requires an url in 
> its metada, so the libvirt namespace needs to be adapted.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to