Skip to content

Conversation

@likitha
Copy link

@likitha likitha commented Jul 1, 2015

…as shared storage.

Fail addition of a VMFS shared storage pool in case it has already been added as local storage in CS.

…as shared storage.

Fail addition of a VMFS shared storage pool in case it has already been added as local storage in CS.
@asfbot
Copy link

asfbot commented Jul 1, 2015

cloudstack-pull-requests #680 SUCCESS
This pull request looks good

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend that all three of these member variables be made private.

@mike-tutkowski
Copy link
Member

Aside from a couple minor comments, LGTM. :)

@remibergsma
Copy link
Contributor

Who wants to step in and finish this work? It seems the original author is not able to finish it. If no one steps in, we'll have to close the PR without merging it so please help :-).

@mike-tutkowski
Copy link
Member

The code LGTM. Are we under the assumption that it was properly tested? If so, I can just merge it at this point.

@remibergsma
Copy link
Contributor

@mike-tutkowski Thanks! It seems the testing / verification is still to do and that is the work. Merging itself can be done with a one-liner. Are you able to verify the fix in your lab?

@asfgit asfgit merged commit 13a98dd into apache:master Aug 11, 2015
@mike-tutkowski
Copy link
Member

Hey...I just noticed something.

I have a datastore that I manually added to my ESXi hosts (shared storage) that is based on an iSCSI target.

When I restart the CS MS, this datastore (which I already added to CloudStack as shared primary storage) gets re-added as local storage (so it's listed as both shared and local primary storages).

I think this is perhaps what led to this pull-request in the first place, but the problem still exists.

What happens now that this pull-request code is in is that the datastore conflict is detected and an error message is printed, but I still see my shared primary storage has been added as well as local storage.

I'm looking into this more, but wanted to point out this observation.

I had forgotten about this issue (I think it's pretty old). At the time, we put in a workaround where datastores that started with "-" or "" were assumed to be shared and not re-added as local. It just happens that my manually added, shared datastore does not start with "-" or "", so I see the problem.

@mike-tutkowski
Copy link
Member

OK, I mainly remembered the issue correctly, but not entirely. The way we avoid this problem (usually) is by looking to see if the datastore starts with "-iqn." or "_iqn.".

If it does, we assume it is not local storage; otherwise, it is assumed to be local storage (an incorrect assumption in this situation that leads to shared storage (that has already been added to CS as shared primary storage) being added to CS as local primary storage).

@mike-tutkowski
Copy link
Member

We need a more robust solution.

Does anyone know how to detect that a datastore does not reside on the local storage of the host in question?

@mike-tutkowski
Copy link
Member

Here is the relevant code (in HostMO.java):

public List<Pair<ManagedObjectReference, String>> getLocalDatastoreOnHost() throws Exception {
    List<Pair<ManagedObjectReference, String>> dsList = new ArrayList<Pair<ManagedObjectReference, String>>();

    ObjectContent[] ocs = getDatastorePropertiesOnHyperHost(new String[] {"name", "summary"});
    if (ocs != null) {
        for (ObjectContent oc : ocs) {
            DatastoreSummary dsSummary = (DatastoreSummary)VmwareHelper.getPropValue(oc, "summary");
            if (dsSummary.isMultipleHostAccess() == false && dsSummary.isAccessible() && dsSummary.getType().equalsIgnoreCase("vmfs")) {
                ManagedObjectReference morDs = oc.getObj();
                String name = (String)VmwareHelper.getPropValue(oc, "name");

                if (!name.startsWith("-iqn.") && !name.startsWith("_iqn.")) {
                    dsList.add(new Pair<ManagedObjectReference, String>(morDs, name));
                }
            }
        }
    }
    return dsList;
}

@mike-tutkowski
Copy link
Member

I see we already do this:

dsSummary.isMultipleHostAccess() == false

But that doesn't seem to work the way we thought.

@mike-tutkowski
Copy link
Member

rohityadavcloud pushed a commit that referenced this pull request Jan 20, 2021
Co-authored-by: Pearl Dsilva <[email protected]>
Signed-off-by: Rohit Yadav <[email protected]>
RodrigoDLopez pushed a commit to RodrigoDLopez/cloudstack that referenced this pull request Aug 23, 2022
… '4.16.0.0-scclouds'

Fix submit not working on SSL Certificates form

Closes apache#547

See merge request scclouds/scclouds!259
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

Successfully merging this pull request may close these issues.

5 participants