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

Fixing issue on changing "disk_mode" #2096 #2271

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alezzandro
Copy link

SUMMARY

Fixing issue on changing "disk_mode" #2096.
As reported in the issue trying to change the disk_mode on an existing vm disk. If the disk is "independent_persistent" and I want to change it to "persistent" no change will be made. Other combinations also won't work.

I edited the vmware_guest_disk.py for including the disk_mode change in the VM reconfiguration if the disk_mode parameter is changing from the existing one.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

community.vmware.vmware_guest_disk

ADDITIONAL INFORMATION

Please note I've just made a small change that still requires you to pass to the module at least the following information:

- name: VMware Change Disk Mode
  hosts: localhost
  tasks:
  - name: Change disk mode for virtual machine using name
    community.vmware.vmware_guest_disk:
      hostname: "{{ vcenter_hostname }}"
      username: "{{ vcenter_username }}"
      password: "{{ vcenter_password }}"
      datacenter: "{{ vcenter_dc }}"
      name: "{{ vm_name }}"
      validate_certs: false
      disk:
        - controller_number: "{{ vm_disk_controller_number }}"
          unit_number: "{{ vm_disk_unit_number }}"
          disk_mode: "persistent" 
          size_kb: "{{ vm_disk_size_kb }}"
    delegate_to: localhost
    register: disk_facts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant