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

Add multiwrite, diskmode, and shares to vcenter_vm_hardware_disks #417

Open
matuck opened this issue May 3, 2023 · 0 comments
Open

Add multiwrite, diskmode, and shares to vcenter_vm_hardware_disks #417

matuck opened this issue May 3, 2023 · 0 comments

Comments

@matuck
Copy link

matuck commented May 3, 2023

SUMMARY

When attaching shared disks to a new host it would be nice to have the ability for multiwrite, shares, and disk mode

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

vcenter_vm_hardware_disk module

ADDITIONAL INFORMATION

One may need to configure any of these settings when attaching disks to a send server

- name: Look up the VM called {{ existingvm }} in vmware inventory
      register: existing_search_result
      vmware.vmware_rest.vcenter_vm_info:
        filter_names:
          - "{{ existingvm }}"

    - name: Collect information about {{ existingvm }}
      register: existing_vm_info
      vmware.vmware_rest.vcenter_vm_info:
        vm: '{{ existing_search_result.value[0].vm }}'

    - name: Look up the VM called {{ newvm }} in vmware inventory
      register: new_search_result
      vmware.vmware_rest.vcenter_vm_info:
        filter_names:
          - "{{ newvm }}"

    - name: Collect information about {{ newvm }}
      register: new_vm_info
      vmware.vmware_rest.vcenter_vm_info:
        vm: '{{ new_search_result.value[0].vm }}'

    - name: Ensure {{ newvm }} has shared disks
      loop: "{{ existing_vm_info.value.disks.values() | list }}"
      when: item.scsi.bus != 0
      vmware.vmware_rest.vcenter_vm_hardware_disk:
        vm: '{{ new_vm_info.id }}'
        type: "{{ item.type }}"
        label: "{{ item.label }}"
        backing:
          type: "{{ item.backing.type }}"
          vmdk_file: "{{ item.backing.vmdk_file }}"
        scsi:
          bus: "{{ item.scsi.bus }}"
          unit: "{{ item.scsi.unit }}"
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

No branches or pull requests

1 participant