Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying OS image on a per-Azure VMSS basis #439

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions ansible/roles/azure/tasks/create_multiple_vmss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@
file: "{{ deploy_path }}/conf/azure_multiple_vmss_vars.yml"
name: azure_multiple_vmss_vars

- name: "Create image plan related facts"
set_fact:
azure_image_plan_name: "{{ azure_image_plan.split('|')[0] }}"
azure_image_plan_dict:
name: "{{ azure_image_plan.split('|')[0] }}"
product: "{{ azure_image_plan.split('|')[1] }}"
publisher: "{{ azure_image_plan.split('|')[2] }}"

- name: Create Scale Set
vars:
image_offer: "{{ azure_image_reference.split('|')[0] }}"
image_publisher: "{{ azure_image_reference.split('|')[1] }}"
image_sku: "{{ azure_image_reference.split('|')[2] }}"
image_version: "{{ azure_image_reference.split('|')[3] }}"
image_id: "{{ azure_image_reference.split('|')[4] }}"
item_image_plan: "{{ item.azure_image_plan | default(azure_image_plan) }}"
azure_image_plan_name: "{{ item_image_plan.split('|')[0] }}"
item_azure_image_reference: "{{ item.azure_image_reference | default(azure_image_reference) }}"
item_azure_image_cloud_init_file: "{{ item.azure_image_cloud_init_file | default(azure_image_cloud_init_file) }}"
azure_image_plan_dict:
name: "{{ item_image_plan.split('|')[0] }}"
product: "{{ item_image_plan.split('|')[1] }}"
publisher: "{{ item_image_plan.split('|')[2] }}"
image_offer: "{{ item_azure_image_reference.split('|')[0] }}"
image_publisher: "{{ item_azure_image_reference.split('|')[1] }}"
image_sku: "{{ item_azure_image_reference.split('|')[2] }}"
image_version: "{{ item_azure_image_reference.split('|')[3] }}"
image_id: "{{ item_azure_image_reference.split('|')[4] }}"
accnet_capable: "{{ True if item.sku in accnet_capable_skus else False }}"
osdisk_sku: "{{ 'Premium_LRS' if item.sku in premiumio_capable_skus else 'Standard_LRS' }}"
azure.azcollection.azure_rm_virtualmachinescaleset:
Expand Down Expand Up @@ -81,7 +81,7 @@
{%- set _ = data_disks.append({'lun': lun, 'disk_size_gb': item.data_disk_size_gb, 'managed_disk_type': item.data_disk_sku, 'caching': item.data_disk_caching|default('ReadOnly') }) -%}
{%- endfor -%}
{{ data_disks }}
custom_data: "{{ lookup('file', azure_image_cloud_init_file) if azure_image_cloud_init_file }}"
custom_data: "{{ lookup('file', item_azure_image_cloud_init_file) if item_azure_image_cloud_init_file }}"
with_items:
- "{{ azure_multiple_vmss_vars.vars_list }}"
register: _create_clusters
Expand Down
7 changes: 2 additions & 5 deletions ansible/roles/azure/tasks/create_optional_proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,13 @@
enable_accelerated_networking: "{{ True if azure_proxy_host_vm_sku in accnet_capable_skus else False }}"
when: azure_proxy_host is defined and azure_proxy_host and azure_proxy_host != None

- name: "Create image plan related facts"
set_fact:
- name: Create azure proxy virtual machine
vars:
azure_proxy_image_plan_name: "{{ azure_proxy_image_plan.split('|')[0] }}"
azure_proxy_image_plan_dict:
name: "{{ azure_proxy_image_plan.split('|')[0] }}"
product: "{{ azure_proxy_image_plan.split('|')[1] }}"
publisher: "{{ azure_proxy_image_plan.split('|')[2] }}"

- name: Create azure proxy virtual machine
vars:
image_offer: "{{ azure_proxy_image_reference.split('|')[0] }}"
image_publisher: "{{ azure_proxy_image_reference.split('|')[1] }}"
image_sku: "{{ azure_proxy_image_reference.split('|')[2] }}"
Expand Down
13 changes: 5 additions & 8 deletions ansible/roles/azure/tasks/create_vmss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,18 @@
luns_dict: "{{ luns_dict | default ([]) + [{ 'lun': item, 'disk_size_gb': disk_size_gb, 'managed_disk_type': data_disk_sku, 'caching': data_disk_caching } ] }}"
with_sequence: start=0 end={{ data_disk_count-1 if data_disk_count > 0 else 0 }}

- name: "Create image plan related facts"
set_fact:
azure_image_plan_name: "{{ azure_image_plan.split('|')[0] }}"
azure_image_plan_dict:
name: "{{ azure_image_plan.split('|')[0] }}"
product: "{{ azure_image_plan.split('|')[1] }}"
publisher: "{{ azure_image_plan.split('|')[2] }}"

- name: Set single placement group to correct value
set_fact:
single_placement_group: False
when: numnodes > 100

- name: Create Scale Set
vars:
azure_image_plan_name: "{{ azure_image_plan.split('|')[0] }}"
azure_image_plan_dict:
name: "{{ azure_image_plan.split('|')[0] }}"
product: "{{ azure_image_plan.split('|')[1] }}"
publisher: "{{ azure_image_plan.split('|')[2] }}"
image_offer: "{{ azure_image_reference.split('|')[0] }}"
image_publisher: "{{ azure_image_reference.split('|')[1] }}"
image_sku: "{{ azure_image_reference.split('|')[2] }}"
Expand Down
3 changes: 3 additions & 0 deletions docs/azure-multiple-vmss.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ Muchos provides a [sample file](../conf/azure_multiple_vmss_vars.yml.example) wh
|-----------|------------------------|---------|-------------|
| `name_suffix` | Required | - | The name of each VMSS is constructed by concatenating the Muchos cluster name with this string. As an example, if your Muchos cluster is called `test`, and this field has a value of `ldr`, then the VMSS is created with a name `test-ldr`|
| `sku` | Required | - | A string identifier specifying the Azure VM size. Refer to the [Azure documentation](https://docs.microsoft.com/en-us/azure/virtual-machines/dv3-dsv3-series) to lookup these strings. An example VM size is `Standard_D32s_v3` for a 32-vCPU [Dsv3](https://docs.microsoft.com/en-us/azure/virtual-machines/dv3-dsv3-series#dsv3-series) VM|
| `azure_image_reference` | Optional | - | If, for whatever reason, you need to use a different Azure VM image for a specific VMSS, please specify the image details in the same format as documented in [Azure image reference](./azure-image-reference.md) |
| `azure_image_plan` | Optional | - | If, for whatever reason, you need to use a different Azure VM image for a specific VMSS, and if that image needs purchase plan information to be specified, please specify the plan information the same format as documented in [Azure image reference](./azure-image-reference.md) |
| `azure_image_cloud_init_file` | Optional | - | If, for whatever reason, you need to use a different Azure VM image for a specific VMSS, and if that image needs a custom cloud init file, please specify the cloud init file name as documented in [Azure image reference](./azure-image-reference.md) |
| `vmss_priority` | Optional | None | If this not specified at each VM level, the value for `vmss_priority` from the `azure` section in [muchos.props](../conf/muchos.props.example) is used | This can be set to `None`, for regular VMs, or `Spot` for [Spot VMs](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/spot-vms).|
| `perf_profile` | Required | - | A string identifying a corresponding performance profile configuration section in muchos.props which contains perf profile parameters |
| `azure_disk_device_path`| Optional | If not specified, the corresponding `azure_disk_device_path` value from the `azure` section in [muchos.props](../conf/muchos.props.example) is used | This is a device path used to enumerate attached SCSI or NVME disks to use for persistent local storage |
Expand Down