|
16 | 16 | // under the License. |
17 | 17 | package org.apache.cloudstack.storage; |
18 | 18 |
|
| 19 | +import java.io.File; |
19 | 20 | import java.util.concurrent.Executors; |
20 | 21 | import java.util.concurrent.ScheduledExecutorService; |
21 | 22 | import java.util.concurrent.TimeUnit; |
22 | 23 |
|
| 24 | +import com.cloud.configuration.Config; |
| 25 | +import com.cloud.configuration.dao.ConfigurationDao; |
| 26 | +import com.cloud.configuration.dao.ConfigurationDaoImpl; |
23 | 27 | import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint; |
24 | 28 | import org.apache.cloudstack.framework.async.AsyncCompletionCallback; |
25 | 29 | import org.apache.cloudstack.storage.command.CopyCommand; |
|
31 | 35 | import com.cloud.resource.ServerResource; |
32 | 36 | import com.cloud.utils.net.NetUtils; |
33 | 37 |
|
| 38 | +import javax.inject.Inject; |
| 39 | + |
34 | 40 | public class LocalHostEndpoint implements EndPoint { |
35 | 41 | private ScheduledExecutorService executor; |
36 | 42 | protected ServerResource resource; |
| 43 | + @Inject |
| 44 | + ConfigurationDao configDao; |
37 | 45 |
|
38 | 46 | public LocalHostEndpoint() { |
39 | | - resource = new LocalNfsSecondaryStorageResource(); |
| 47 | + // get mount parent folder configured in global setting, if set, this will overwrite _parent in NfsSecondaryStorageResource to work |
| 48 | + // around permission issue for default /mnt folder |
| 49 | + String mountParent = configDao.getValue(Config.MountParent.key()); |
| 50 | + |
| 51 | + String path = mountParent + File.separator + "secStorage"; |
| 52 | + |
| 53 | + LocalNfsSecondaryStorageResource localResource = new LocalNfsSecondaryStorageResource(); |
| 54 | + localResource.setParentPath(path); |
| 55 | + resource = localResource; |
40 | 56 | executor = Executors.newScheduledThreadPool(10); |
41 | 57 | } |
42 | 58 |
|
|
0 commit comments