cloudstack/plugins
Rafael Weingärtner 060715e9f5
[CLOUDSTACK-10241] Duplicated file SRs being created in XenServer pools (#2414)
* [CLOUDSTACK-10241] Duplicated file SRs being created in XenServer pools

Due to a race condition between multiple management servers, in some rare cases, CloudStack is creating multiple file SRs to the same secondary folder. This causes a problem when introducing the SR to the XenServer pools, as “there will be VDIs with duplicated UUIDs“. The VDIs are the same, but they are seen in different SRs, and therefore cause an error.

The solution to avoid race conditions between management servers is to use a deterministic srUuid for the file SR to be created (we are leaving XenServer with the burden of managing race conditions). The UUID is based on the SR file path and is generated using  UUID#nameUUIDFromBytes. Therefore, if there is an SR with the generated UUID, this means that some other management server has just created it. An exception will occur and it will contain a message saying 'Db_exn.Uniqueness_constraint_violation'. In these unlikely events, we catch the exception and use the method retrieveAlreadyConfiguredSrWithoutException to get the SR that has already been created for the given mount point.
2018-03-29 15:55:42 -03:00
..
acl Updating pom.xml version numbers for release 4.11.1.0-SNAPSHOT 2018-02-26 16:57:48 +01:00
affinity-group-processors Updating pom.xml version numbers for release 4.11.1.0-SNAPSHOT 2018-02-26 16:57:48 +01:00
alert-handlers Updating pom.xml version numbers for release 4.11.1.0-SNAPSHOT 2018-02-26 16:57:48 +01:00
api Updating pom.xml version numbers for release 4.11.1.0-SNAPSHOT 2018-02-26 16:57:48 +01:00
ca/root-ca Updating pom.xml version numbers for release 4.11.1.0-SNAPSHOT 2018-02-26 16:57:48 +01:00
database Updating pom.xml version numbers for release 4.11.1.0-SNAPSHOT 2018-02-26 16:57:48 +01:00
dedicated-resources Updating pom.xml version numbers for release 4.11.1.0-SNAPSHOT 2018-02-26 16:57:48 +01:00
deployment-planners Updating pom.xml version numbers for release 4.11.1.0-SNAPSHOT 2018-02-26 16:57:48 +01:00
event-bus Merge branch '4.11' 2018-03-12 16:15:46 +05:30
file-systems/netapp Updating pom.xml version numbers for release 4.11.1.0-SNAPSHOT 2018-02-26 16:57:48 +01:00
ha-planners/skip-heurestics Updating pom.xml version numbers for release 4.11.1.0-SNAPSHOT 2018-02-26 16:57:48 +01:00
host-allocators/random Updating pom.xml version numbers for release 4.11.1.0-SNAPSHOT 2018-02-26 16:57:48 +01:00
hypervisors [CLOUDSTACK-10241] Duplicated file SRs being created in XenServer pools (#2414) 2018-03-29 15:55:42 -03:00
integrations Updating pom.xml version numbers for release 4.11.1.0-SNAPSHOT 2018-02-26 16:57:48 +01:00
metrics Updating pom.xml version numbers for release 4.11.1.0-SNAPSHOT 2018-02-26 16:57:48 +01:00
network-elements Merge branch '4.11' 2018-03-15 16:46:50 +05:30
outofbandmanagement-drivers Updating pom.xml version numbers for release 4.11.1.0-SNAPSHOT 2018-02-26 16:57:48 +01:00
storage Updating pom.xml version numbers for release 4.11.1.0-SNAPSHOT 2018-02-26 16:57:48 +01:00
storage-allocators/random Updating pom.xml version numbers for release 4.11.1.0-SNAPSHOT 2018-02-26 16:57:48 +01:00
user-authenticators Updating pom.xml version numbers for release 4.11.1.0-SNAPSHOT 2018-02-26 16:57:48 +01:00
pom.xml Updating pom.xml version numbers for release 4.11.1.0-SNAPSHOT 2018-02-26 16:57:48 +01:00