Explorar o código

Plan information for Azure MarketPlace images

almahmoud %!s(int64=7) %!d(string=hai) anos
pai
achega
530877d8e9
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      cloudbridge/cloud/providers/azure/services.py

+ 8 - 0
cloudbridge/cloud/providers/azure/services.py

@@ -567,6 +567,14 @@ class AzureInstanceService(BaseInstanceService):
         if not temp_key_pair:
             params['tags'].update(Key_Pair=key_pair.id)
 
+        image_ref = storage_profile.get('image_reference')
+        if image_ref:
+            sku = image_ref.get('sku')
+            if sku:
+                params.update(plan={"name": sku,
+                                    "publisher": image_ref.get("publisher"),
+                                    "product": image_ref.get("offer")})
+
         try:
             vm = self.provider.azure_client.create_vm(instance_name, params)
         except Exception as e: