Hi everyone,
I have 5 vms on azure. The ansible yml can start vm (z1, z2, z3) but when try to start b1 and b2 got error:
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'diskSizeGB'
failed: [localhost] (item=b1) => {"ansible_loop_var": "item", "changed": false, "item": "b1", "module_stderr": "Traceback (most recent call last):\n File "/home/achg/.ansible/tmp/ansible-tmp-1679583837.0334876-167289663996467/AnsiballZ_azure_rm_virtualmachine.py", line 102, in <module>\n _ansiballz_main()\n File "/home/achg/.ansible/tmp/ansible-tmp-1679583837.0334876-167289663996467/AnsiballZ_azure_rm_virtualmachine.py", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/home/achg/.ansible/tmp/ansible-tmp-1679583837.0334876-167289663996467/AnsiballZ_azure_rm_virtualmachine.py", line 40, in invoke_module\n runpy.run_module(mod_name='ansible.modules.cloud.azure.azure_rm_virtualmachine', init_globals=None, run_name='main', alter_sys=True)\n File "/usr/lib/python3.8/runpy.py", line 207, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code...
DETAILS: vms b1 and b2 has two more disks attached
- name: Start all machines
hosts: localhost
vars:
list_of_Servers:
- z1
- z2
- z3
- b1
- b2
tasks:
- name: Start all machines task
azure_rm_virtualmachine:
resource_group: cluster-ansible
name: "{{ item }}"
started: true
state: present
loop: "{{ list_of_Servers }}"