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 support vPMem disk config in vmware_guest_disk module #1382

Merged

Conversation

Tomorrow9
Copy link
Collaborator

Signed-off-by: dianew dianew@vmware.com

SUMMARY

Add a new disk type for supporting add, reconfigure, remove vPMem disk like this:

- name: Add a new vPMem disk to virtual machine to SATA controller
  community.vmware.vmware_guest_disk:
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_username }}"
    password: "{{ vcenter_password }}"
    datacenter: "{{ datacenter_name }}"
    validate_certs: no
    name: VM_226
    disk:
      - type: vpmemdisk
        size_gb: 1
        state: present
        controller_type: sata
        controller_number: 1
        unit_number: 2
  delegate_to: localhost
  register: disk_facts
ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

vmware_guest_disk

ADDITIONAL INFORMATION
ok: [localhost] => {
    "results": {
        "changed": true,
        "disk_changes": {
            "0": "Disk created."
        },
        "disk_data": {
            "0": {
                "backing_datastore": "datastore4",
                "backing_disk_mode": "persistent",
                "backing_eagerlyscrub": false,
                "backing_filename": "[datastore4] dw_winsrv/dw_winsrv-000002.vmdk",
                "backing_sharing": "sharingNone",
                "backing_thinprovisioned": true,
                "backing_uuid": "6000C29d-2508-d42f-9b83-d0dbaf8ac842",
                "backing_writethrough": false,
                "capacity_in_bytes": 96636764160,
                "capacity_in_kb": 94371840,
                "controller_key": 1000,
                "iolimit_limit": -1,
                "iolimit_shares_level": "normal",
                "iolimit_shares_limit": 1000,
                "key": 2000,
                "label": "Hard disk 1",
                "shares_level": "normal",
                "shares_limit": 1000,
                "summary": "94,371,840 KB",
                "unit_number": 0
            },
            "1": {
                "backing_datastore": "PMemDS-d615280a-5aed-2943-bc3a-a05c181c6b0d",
                "backing_disk_mode": "persistent",
                "backing_filename": "[PMemDS-d615280a-5aed-2943-bc3a-a05c181c6b0d] dw_winsrv/dw_winsrv.vmdk",
                "backing_sharing": null,
                "backing_uuid": "6000C29e-9fb3-a74a-abed-5e264ec14367",
                "capacity_in_bytes": 1073741824,
                "capacity_in_kb": 1048576,
                "controller_key": 1001,
                "iolimit_limit": -1,
                "iolimit_shares_level": "normal",
                "iolimit_shares_limit": 1000,
                "key": 2020,
                "label": "Hard disk 2",
                "shares_level": "normal",
                "shares_limit": 1000,
                "summary": "1,048,576 KB",
                "unit_number": 4
            }
        },
        "failed": false
    }
}

Signed-off-by: dianew <dianew@vmware.com>
Signed-off-by: dianew <dianew@vmware.com>
@softwarefactory-project-zuul
Copy link

@Tomorrow9
Copy link
Collaborator Author

Hi @mariolenz @sky-joker would you please help reviewing this change? Thanks.

Copy link
Collaborator

@mariolenz mariolenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't test this because we don't have any PMem / NVM but the code looks good to me.

@sky-joker Could youo also please have a look?

@mariolenz mariolenz requested a review from sky-joker July 7, 2022 07:18
Copy link
Collaborator

@sky-joker sky-joker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @Tomorrow9 for the patch!
LGTM

@softwarefactory-project-zuul
Copy link

Build succeeded (gate pipeline).

✔️ ansible-tox-linters SUCCESS in 4m 05s
✔️ build-ansible-collection SUCCESS in 3m 52s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 9m 32s
✔️ ansible-test-units-community-vmware-python38 SUCCESS in 4m 23s
✔️ ansible-galaxy-importer SUCCESS in 3m 50s

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

Successfully merging this pull request may close these issues.

None yet

3 participants