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

new state in vmware_host_datastore to differentiate between unmount and remove #2006

Open
christian-naenny opened this issue Feb 23, 2024 · 2 comments

Comments

@christian-naenny
Copy link

SUMMARY

If I use state: absent in the vmware_host_datastore module, the VMFS volume is removed!
But I do not want to remove it, I only want to unmount the VMFS volume

I would like to do what I already did in PowerShell as
$StorageSys.UnmountVmfsVolume($DS.ExtensionData.Info.vmfs.uuid);

In the function umount_datastore_host in vmware_host_datastore.py
the code is:
self.esxi.configManager.datastoreSystem.RemoveDatastore(ds)

but this is not an unmount, this is a remove! There is a difference between these two!

The code for an unmount should be something like this:
self.esxi.configManager.datastoreSystem.UnmountVMFSVolume(ds)

ISSUE TYPE
  • Feature Idea
  • Bug
COMPONENT NAME

community.vmware.vmware_host_datastore

ADDITIONAL INFORMATION

Later in the process, I need to mount the VMFS Volumes again, this does not work if I removed the Datastore using the current solution of the module.

- name: "Unmount datastores"
  community.vmware.vmware_host_datastore:
    datastore_name: "{{ $dsName }}"
    datastore_type: vmfs
    esxi_hostname: "{{ $esxHostName }}"
    vmfs_device_name: "naa.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    vmfs_version: 6
    state: dismount   # or any other value other than absent
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
@sathyapj
Copy link

+1. I tried this module for 'Unmount' function. Realized this module will Remove the datastore. Fortunately, the datastore was empty with no vms. Otherwise, I will be in a trouble at work!!

@sathyapj
Copy link

Module shows 'absent' is unmount. But it's trying to remove the datastore.

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

2 participants