Added check for 'memory' key in numa is present to use 24/5724/2 v3.0.2
authordhumal <kdhumal@vmware.com>
Thu, 23 Nov 2017 05:41:41 +0000 (21:41 -0800)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Thu, 23 Nov 2017 17:23:26 +0000 (19:23 +0200)
Change-Id: I80a091664ced7588bc0065c043a090c47a936893
Signed-off-by: dhumal <kdhumal@vmware.com>
osm_ro/vimconn_openstack.py

index 7b1415b..65e17b5 100644 (file)
@@ -686,7 +686,9 @@ class vimconnector(vimconn.vimconnector):
                             numa_properties["vmware:latency_sensitivity_level"] = "high"
                         for numa in numas:
                             #overwrite ram and vcpus
-                            ram = numa['memory']*1024
+                            #check if key 'memory' is present in numa else use ram value at flavor
+                            if 'memory' in numa:
+                                ram = numa['memory']*1024
                             #See for reference: https://specs.openstack.org/openstack/nova-specs/specs/mitaka/implemented/virt-driver-cpu-thread-pinning.html
                             if 'paired-threads' in numa:
                                 vcpus = numa['paired-threads']*2