VMware {code} Community
helpme201110141
Contributor
Contributor

Mapping a datastore to Multiple hosts

Hi All,

             I am new to storage domain. I have a query regarding datastore.

               I have created a datastore (to be specific VMFSDatastore).....My query is, can we map a datastore to multiple hosts.......

                 i tried finiding it but i am not getting a concrete answer........

             i tried using Vsphere Java API but i coulnd find any way of doing it.............

please help me out...

Thanks in advance...

0 Kudos
3 Replies
lamw
Community Manager
Community Manager

Yes, if you have a reference to datastore mor, there is a property called host which contains an array of hosts who currently attach to the datastore. Take a look at the vSphere API reference for more details - http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.Datastore.html

0 Kudos
helpme201110141
Contributor
Contributor

Hi lamw,

            Thanks for the reply......

               what you are saying is checking how many hosts are using a datastore which i belive is fine but my query is while creating a datastore, can it be mapped to more than hosts.

As per my understanding, A datastore is used as storage for Vertual machine on a host( though vertual machines from different Hosts can use same datastore but i guess this is doen while creating a vertual machine on a host) .

The link which you have given says

"Datastores are configured per host. As part of host configuration, a HostSystem can be configured to mount a set of network drives. Multiple hosts may be configured to point to the same storage location. There exists only one Datastore object per Datacenter, for each such shared location. Each Datastore object keeps a reference to the set of hosts that have mounted the datastore. A Datastore object can be removed only if no hosts currently have the datastore mounted.

Thus, managing datastores is done both at the host level and the datacenter level. Each host is configured explicitly with the set of datastores it can access. At the datacenter, a view of the datastores across the datacenter is shown."

Which i have interpreted as, only one host can manage a datastore (i.e Datastored will be mapped to only one datastore) but mutiple hosts can use same datastore as storage for their vertual machines( this i believe can be done while creating vertual machine on a host and specifying the storage path to be used by this vertual machine).

Please correct me if i am wrong.

Thanks,

Ini

0 Kudos
lamw
Community Manager
Community Manager

Yes, you can check the number of hosts and which hosts is using a datastore after you're created it. You're correct that only 1 host would initially manage the creation of the VMFS filesystem and from there, assuming all physical connections + zoning/masking is there, other hosts can re-scan and pickup access to these shared volume if we're talking about FC/iSCSI or NFS. After that, you can manage that shared volume using any of the hosts, you really wanted to you could delete the volume and then have the other hosts rescan and it would disappear (be careful if you do this for VMFS volumes).

Hopefully this clears up any confusion and let me know if you have more questions

0 Kudos