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

Get the NFS Server details for datastore #46156

Closed
Popyllol opened this issue Sep 26, 2018 · 8 comments · Fixed by #46546
Closed

Get the NFS Server details for datastore #46156

Popyllol opened this issue Sep 26, 2018 · 8 comments · Fixed by #46546
Labels
affects_2.8 This issue/PR affects Ansible v2.8 cloud feature This issue/PR relates to a feature request. module This issue/PR relates to a module. needs_maintainer Ansibot is unable to identify maintainers for this PR. (Check `author` in docs or BOTMETA.yml) support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. vmware VMware community

Comments

@Popyllol
Copy link

SUMMARY

It would be very nice to get more details about the VMWare datastore. In case of a NFS datastore I would love to get the NFS server and the path on the NFS server.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

vmware_datastore_facts.py

ADDITIONAL INFORMATION

I need the data about NFS source to select the right NetApp where I have to create a snapshot.

  - name: "Gather guest facts"
    delegate_to: localhost
    become:      false
    vmware_guest_facts:
      hostname:       '{{ vcenter_hostname }}'
      username:       '{{ vcenter_username }}'
      password:       '{{ vcenter_password }}'
      datacenter:     '{{ vm_datacenter }}'
      validate_certs: no
      folder:         '{{ vm_folder.folders }}'
      name:           '{{ inventory_hostname }}'
    register: vm_facts

  - name: "Gather datastore facts"
    delegate_to: localhost
    become:      false
    vmware_datastore_facts:
      hostname:       '{{ vcenter_hostname }}'
      username:       '{{ vcenter_username }}'
      password:       '{{ vcenter_password }}'
      datacenter:     '{{ vm_datacenter }}'
      validate_certs: no
      name:           '{{ item }}'
    register: vm_datastore_facts
    with_items:
      - '{{ vm_facts.instance.hw_datastores }}'

  - debug:
      msg: '{{ vm_datastore_facts }}'

Now I get:

...
                    {
                        "accessible": true, 
                        "capacity": 429496729600, 
                        "datastore_cluster": "N/A", 
                        "freeSpace": 316892692480, 
                        "maintenanceMode": "normal", 
                        "multipleHostAccess": true, 
                        "name": "svm35_webapp1_web001", 
                        "provisioned": 1006747443200, 
                        "type": "NFS", 
                        "uncommitted": 894143406080, 
                        "url": "ds:///vmfs/volumes/6f8b2cfd-7de80f72/"
                    }
...

What I want to get:

...
                    {
                        "accessible": true, 
                        "capacity": 429496729600, 
                        "datastore_cluster": "N/A", 
                        "freeSpace": 316892692480, 
                        "maintenanceMode": "normal", 
                        "multipleHostAccess": true, 
                        "name": "svm35_webapp1_web001", 
                        "provisioned": 1006747443200, 
                        "type": "NFS", 
                        "nfs_server": "filer01",
                        "nfs_path": "/data",
                        "uncommitted": 894143406080, 
                        "url": "ds:///vmfs/volumes/6f8b2cfd-7de80f72/"
                    }
...
@ansibot
Copy link
Contributor

ansibot commented Sep 26, 2018

@ansibot
Copy link
Contributor

ansibot commented Sep 26, 2018

@ansibot
Copy link
Contributor

ansibot commented Sep 26, 2018

Hi @Popyllol,

Thank you for the issue, just so you are aware we have a dedicated Working Group for vmware.
You can find other people interested in this in #ansible-vmware on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 cloud feature This issue/PR relates to a feature request. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. vmware VMware community labels Sep 26, 2018
@Akasurde Akasurde removed the needs_triage Needs a first human triage before being processed. label Sep 26, 2018
@ckotte
Copy link
Contributor

ckotte commented Oct 3, 2018

I'm already working on it. Need more time for testing (NFS41, etc. pp.) before creating the PR.

The output looks like this:

ok: [esxi_host.local] => (item={u'accessible': True, u'freeSpace': 108918902784, u'multipleHostAccess': True, u'capacity': 141666816000, u'name': u'glustervol1-software', u'provisioned': 32747913216, u'url': u'ds:///vmfs/volumes/7d7c070e-cdeb2ddb-0000-000000000000/', u'datastore_cluster': u'N/A', u'nfs_path': u'/glustervol1/Software', u'uncommitted': 0, u'nfs_server': u'nfs_server.local', u'type': u'NFS41', u'maintenanceMode': u'normal'}) => {
    "msg": {
        "accessible": true,
        "capacity": 141666816000,
        "datastore_cluster": "N/A",
        "freeSpace": 108918902784,
        "maintenanceMode": "normal",
        "multipleHostAccess": true,
        "name": "glustervol1-software",
        "nfs_path": "/glustervol1/Software",
        "nfs_server": "nfs_server.local",
        "provisioned": 32747913216,
        "type": "NFS41",
        "uncommitted": 0,
        "url": "ds:///vmfs/volumes/7d7c070e-cdeb2ddb-0000-000000000000/"
    }
}

@ansibot ansibot added the needs_maintainer Ansibot is unable to identify maintainers for this PR. (Check `author` in docs or BOTMETA.yml) label Oct 3, 2018
@ckotte
Copy link
Contributor

ckotte commented Oct 5, 2018

@Popyllol Could you try my PR?

@Popyllol
Copy link
Author

Popyllol commented Oct 5, 2018 via email

@ckotte
Copy link
Contributor

ckotte commented Oct 5, 2018 via email

@Popyllol
Copy link
Author

Popyllol commented Oct 5, 2018 via email

@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 cloud feature This issue/PR relates to a feature request. module This issue/PR relates to a module. needs_maintainer Ansibot is unable to identify maintainers for this PR. (Check `author` in docs or BOTMETA.yml) support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. vmware VMware community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants