VMware {code} Community
ChrisW199
Contributor
Contributor

Adding & Removing VMFS datastores without deleting contents

I have an ESXi server which is configured and connected to an iSCSI target (RHEL5 with iscsi-target installed).

My question is how do i go about:

  1. creating a VMFS datastore on a LUN on this iSCSI target

  2. Removing the datastore (*WITHOUT* erasing the contents)

  3. Adding the datastore back in at a later date (with the preserved contents)

I can create a VMFS datastore using the code from this thread: http://communities.vmware.com/thread/215818. This works as expected an i can upload a file to the datastore (using the VI client) and check it persists between iSCSI target and ESXi host reboots.

I assume that i can remove (not destoy) a datastore calling RemoveDatastore(datastoreSystemMOR, datastoreMOR). This work as expected and the datstore is removed (as observed from the VI client).

How do i go about re-adding the datastore (similar to step 1 with some addition tweaking of the spec?) *WITHOUT* formatting the LUN? (and thus my files are still present?).

I did see another post saying that DestroyDatastore and RemoveDatastore were doing the same thing (wiping the contents): http://communities.vmware.com/message/1164044. Has this been fixed yet?

Any help would be appreciated.

http://communities.vmware.com/message/1164044

0 Kudos
0 Replies