Remove duplicate datastore entries from vm-snapshot in WebGUI
In the WebGUI of TrueNAS 11.1-U6.3 we get the attached screenshot. The duplicate names seem to be because the vcenter server is reporting the same datastore on multiple ESXi hosts and we aren't removing the duplicates. Please fix this so the list excludes duplicates.
Also please sort the list alphabetically for easier navigation.
Marking as public so the affected customer can monitor the progress of this issue.
Note: This used to not be a problem, so I'm guessing that ESXi has changed their responses to API queries to include all of the esxi hosts and datastores without considering the fact that duplicates may exist.
#5 Updated by Waqar Ahmed over 1 year ago
- Status changed from In Progress to Blocked
- Reason for Blocked set to Need additional information from Author
Hello Joshua, so i have gone through how we retrieve the list currently and it seems that this is not how it looks. The datastores being retrieved are from different esxi hosts meaning that they would not be exact duplicates ( if i am not wrong ? ). This brings us to the question that we can't identify datastores by their names only as it wouldn't be unique among different esxi hosts. We should store the esxi host as well with the name so we can target the correct esxi host with datastore. Could you please verify this or maybe tell me a little more about the setup of the esxi hosts and datastores. I can reproduce this and dig further of how to take care of this. Thank you
#6 Updated by Joshua Sirrine over 1 year ago
I'm not sure why we can't use the datastore names. If you have ESXi1 with a datastore named 'Test' and you mount that store on ESXi2, it will get the same name. I just tested renaming a datastore on one host, and the other hose picked up the new name on a rescan.
Changed the name:
2019-03-06T00:00:13.146Z cpu0:34136 opID=7632de90)HBX: 4164: 1 stale HB slot(s) owned by me have been garbage collected on vol 'Test_Test'
2019-03-06T00:00:13.179Z cpu0:34136 opID=7632de90)Vol3: 2909: 'Test_Test_Z20' (FS 5c7ef126-68660855-8f9f-000c2963f70e): FS rename succeeded, was Test_Test
Name showed up on other ESXi host:
2019-03-06T00:01:49.924Z cpu9:2103789)Vol3: 2545: vol 'Test_Test': Filesystem name change detected. New name: 'Test_Test_Z20'.
This is also going to be more confusing if we're connecting to a vcenter server that has a cluster of ESXi hosts (which is the common configuration for most of our TrueNAS users).
We should store the esxi host as well with the name so we can target the correct esxi host with datastore.
That is not an option if they are a cluster of ESXi hosts. That's why we let people connect to vcenter servers instead of esxi hosts. Then vcenter is supposed to do the heavy work and figure this stuff out. Also, as I demonstrated above, they should all have the same name because of how vmfs works.
Could you please verify this or maybe tell me a little more about the setup of the esxi hosts and datastores.
I'm not sure what you want to know. They have a vcenter server with several esxi hosts connected to it. The ESXi hosts all use storage from the TrueNAS, and a given datastore has a given name among all hosts. Unfortunately, the WebGUI of the TrueNAS lists multiple entries for what appears to be the same datastore, confusing the end-user, and making them question if this is even working properly. I presume its seeing each esxi host as a different datastore, which shouldn't be happening if they are all connecting to the same vcenter server.
If the TrueNAS is connecting to an esxi host specifically, there is no room for this bug ticket to apply as there is no way you can have a single esxi host with multiple datastores with the same name. ESXi does not allow that.
Does that clarify anything? If not we can do a phone call and I'll try to explain.
#7 Updated by Waqar Ahmed over 1 year ago
Thank you Joshua for the explanation. Yes that clarifies a lot of things. I have read a few docs on datastores as well and please confirm if the following findings are accurate:
1) Datastore names are unique under a single vcenter server.
2) When we have a vcenter server, same datastore can be used with more then one esxi host
3) Datastores are a separate entity and we can't have same names for datastores even when we talk about them being used with different hosts under a single server of course - ( meaning if we have same name of a datastore among different hosts, that means that it is only a single datastore which is being pointed at and is being used by multiple esxi hosts )
4) Reflecting on the above points, this means that a datastore name is enough to solely identify and use a datastore irrespective of the fact that the same datastore might be being used by different hosts ( it is still the same ).
I think we are on the same page, but for assurance please confirm if the above points are correct, and if yes, i'll have the necessary changes made to accommodate this. Thank you
#13 Updated by Dru Lavigne over 1 year ago
- Status changed from Ready for Testing to Done
- Target version changed from 11.3-BETA1 to Master - FreeNAS Nightlies
- Reason for Blocked deleted (
Need additional information from Author)
- Needs QA changed from Yes to No
- Needs Doc changed from Yes to No
- Needs Merging changed from Yes to No