Browse Source

Merge pull request #8917 from kwoodson/azure_variable_instance_size

Variablizing vm size for azure.
Jim Minter 6 years ago
parent
commit
09009122b9

+ 6 - 0
playbooks/azure/openshift-cluster/launch.yml

@@ -50,16 +50,22 @@
         value: "{{ openshift_azure_input_image_name }}"
       - key: properties.masterProfile.imageReference.resourceGroup
         value: "{{ openshift_azure_input_image_ns }}"
+      - key: properties.masterProfile.vmSize
+        value: "{{ openshift_azure_vm_size | default('Standard_D4s_v3') }}"
       # agentpool compute
       - key: properties.agentPoolProfiles[0].imageReference.name
         value: "{{ openshift_azure_input_image_name }}"
       - key: properties.agentPoolProfiles[0].imageReference.resourceGroup
         value: "{{ openshift_azure_input_image_ns }}"
+      - key: properties.agentPoolProfiles[0].vmSize
+        value: "{{ openshift_azure_vm_size | default('Standard_D4s_v3') }}"
       # agentpool infra
       - key: properties.agentPoolProfiles[1].imageReference.name
         value: "{{ openshift_azure_input_image_name }}"
       - key: properties.agentPoolProfiles[1].imageReference.resourceGroup
         value: "{{ openshift_azure_input_image_ns }}"
+      - key: properties.agentPoolProfiles[1].vmSize
+        value: "{{ openshift_azure_vm_size | default('Standard_D4s_v3') }}"
       # linuxprofile
       - key: properties.linuxProfile.adminUsername
         value: "cloud-user"

+ 4 - 0
playbooks/azure/openshift-cluster/provisioning_vars.yml.example

@@ -23,6 +23,9 @@ openshift_azure_output_image_ns: images
 # complete name of output image, e.g. centos7-base-201806071412 or centos7-3.10-201806071434
 openshift_azure_output_image_name:
 
+# azure vm image size, defaults to Standard_D4s_v3
+openshift_azure_vm_size:
+
 # ssh public key for VMs created by playbook; private key must be accessible to
 # ansible
 openshift_azure_vm_ssh_public_key: ssh-rsa ...
@@ -53,3 +56,4 @@ openshift_azure_vm_ssh_public_key: ssh-rsa ...
 
 # container within storage account to hold image blob
 #openshift_azure_container:
+

+ 1 - 1
playbooks/azure/openshift-cluster/tasks/provision_instance.yml

@@ -25,7 +25,7 @@
     az vm create
     -n vm
     -g "{{ openshift_azure_resource_group_name }}"
-    --size Standard_D4s_v3
+    --size "{{ openshift_azure_vm_size | default('Standard_D4s_v3') }}"
     --image "{{ (input_image.stdout | from_json).id }}"
     --storage-sku Premium_LRS
     --admin-username cloud-user