Skip to content

Commit 777f98a

Browse files
committed
CLOUDSTACK-9368: Fix for Support configurable NFS version for Secondary Storage mounts
1 parent 4d57ec0 commit 777f98a

File tree

40 files changed

+380
-164
lines changed

40 files changed

+380
-164
lines changed

api/src/com/cloud/agent/api/to/NfsTO.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public class NfsTO implements DataStoreTO {
2424
private DataStoreRole _role;
2525
private String uuid;
2626
private static final String pathSeparator = "/";
27+
private Integer nfsVersion;
2728

2829
public NfsTO() {
2930

@@ -71,4 +72,12 @@ public void setUuid(String uuid) {
7172
public String getPathSeparator() {
7273
return pathSeparator;
7374
}
75+
76+
public Integer getNfsVersion() {
77+
return nfsVersion;
78+
}
79+
80+
public void setNfsVersion(Integer nfsVersion) {
81+
this.nfsVersion = nfsVersion;
82+
}
7483
}

core/src/com/cloud/agent/api/BackupSnapshotCommand.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public class BackupSnapshotCommand extends SnapshotCommand {
3939
private S3TO s3;
4040
StorageFilerTO pool;
4141
private Long secHostId;
42-
private String nfsVersion;
4342

4443
protected BackupSnapshotCommand() {
4544

@@ -109,11 +108,4 @@ public Long getSecHostId() {
109108
return secHostId;
110109
}
111110

112-
public String getNfsVersion() {
113-
return nfsVersion;
114-
}
115-
116-
public void setNfsVersion(String nfsVersion) {
117-
this.nfsVersion = nfsVersion;
118-
}
119111
}

core/src/com/cloud/agent/api/CreatePrivateTemplateFromSnapshotCommand.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public class CreatePrivateTemplateFromSnapshotCommand extends SnapshotCommand {
2828
private String origTemplateInstallPath;
2929
private Long newTemplateId;
3030
private String templateName;
31-
private String nfsVersion;
3231

3332
protected CreatePrivateTemplateFromSnapshotCommand() {
3433

@@ -74,11 +73,4 @@ public String getTemplateName() {
7473
return templateName;
7574
}
7675

77-
public String getNfsVersion() {
78-
return nfsVersion;
79-
}
80-
81-
public void setNfsVersion(String nfsVersion) {
82-
this.nfsVersion = nfsVersion;
83-
}
8476
}

core/src/com/cloud/agent/api/CreatePrivateTemplateFromVolumeCommand.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public class CreatePrivateTemplateFromVolumeCommand extends SnapshotCommand {
3232
StorageFilerTO _primaryPool;
3333
// For XenServer
3434
private String _secondaryStorageUrl;
35-
private String nfsVersion;
3635

3736
public CreatePrivateTemplateFromVolumeCommand() {
3837
}
@@ -101,11 +100,4 @@ public void setTemplateId(long templateId) {
101100
_templateId = templateId;
102101
}
103102

104-
public String getNfsVersion() {
105-
return nfsVersion;
106-
}
107-
108-
public void setNfsVersion(String nfsVersion) {
109-
this.nfsVersion = nfsVersion;
110-
}
111103
}

core/src/com/cloud/agent/api/CreateVolumeFromSnapshotCommand.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
*/
2727
public class CreateVolumeFromSnapshotCommand extends SnapshotCommand {
2828

29-
private String nfsVersion;
30-
3129
protected CreateVolumeFromSnapshotCommand() {
3230

3331
}
@@ -53,11 +51,4 @@ public CreateVolumeFromSnapshotCommand(StoragePool pool, String secondaryStorage
5351
setWait(wait);
5452
}
5553

56-
public String getNfsVersion() {
57-
return nfsVersion;
58-
}
59-
60-
public void setNfsVersion(String nfsVersion) {
61-
this.nfsVersion = nfsVersion;
62-
}
6354
}

core/src/com/cloud/agent/api/GetStorageStatsCommand.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@
2020
package com.cloud.agent.api;
2121

2222
import com.cloud.agent.api.LogLevel.Log4jLevel;
23+
import com.cloud.agent.api.storage.StorageNfsVersionCommand;
2324
import com.cloud.agent.api.to.DataStoreTO;
2425
import com.cloud.storage.Storage.StoragePoolType;
2526

2627
@LogLevel(Log4jLevel.Trace)
27-
public class GetStorageStatsCommand extends Command {
28+
public class GetStorageStatsCommand extends StorageNfsVersionCommand {
2829
private String id;
2930
private String localPath;
3031
private StoragePoolType pooltype;
3132
private String secUrl;
3233
private DataStoreTO store;
33-
private String nfsVersion;
3434

3535
public String getSecUrl() {
3636
return secUrl;
@@ -55,9 +55,9 @@ public GetStorageStatsCommand(DataStoreTO store) {
5555
this.store = store;
5656
}
5757

58-
public GetStorageStatsCommand(DataStoreTO store, String nfsVersion) {
58+
public GetStorageStatsCommand(DataStoreTO store, Integer nfsVersion) {
59+
super(nfsVersion);
5960
this.store = store;
60-
this.nfsVersion = nfsVersion;
6161
}
6262

6363
public GetStorageStatsCommand(String secUrl) {
@@ -87,14 +87,6 @@ public DataStoreTO getStore() {
8787
return this.store;
8888
}
8989

90-
public String getNfsVersion() {
91-
return nfsVersion;
92-
}
93-
94-
public void setNfsVersion(String nfsVersion) {
95-
this.nfsVersion = nfsVersion;
96-
}
97-
9890
@Override
9991
public boolean executeInSequence() {
10092
return false;

core/src/com/cloud/agent/api/SecStorageSetupCommand.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121

2222
import org.apache.cloudstack.framework.security.keystore.KeystoreManager;
2323

24+
import com.cloud.agent.api.storage.StorageNfsVersionCommand;
2425
import com.cloud.agent.api.to.DataStoreTO;
2526

26-
public class SecStorageSetupCommand extends Command {
27+
public class SecStorageSetupCommand extends StorageNfsVersionCommand {
2728
private DataStoreTO store;
2829
private String secUrl;
2930
private KeystoreManager.Certificates certs;
3031
private String postUploadKey;
31-
private String nfsVersion;
3232

3333

3434
public SecStorageSetupCommand() {
@@ -76,11 +76,4 @@ public void setPostUploadKey(String postUploadKey) {
7676
this.postUploadKey = postUploadKey;
7777
}
7878

79-
public String getNfsVersion() {
80-
return nfsVersion;
81-
}
82-
83-
public void setNfsVersion(String nfsVersion) {
84-
this.nfsVersion = nfsVersion;
85-
}
8679
}

core/src/com/cloud/agent/api/SnapshotCommand.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@
1919

2020
package com.cloud.agent.api;
2121

22+
import com.cloud.agent.api.storage.StorageNfsVersionCommand;
2223
import com.cloud.agent.api.to.StorageFilerTO;
2324
import com.cloud.storage.StoragePool;
2425

2526
/**
2627
* This currently assumes that both primary and secondary storage are mounted on
2728
* the XenServer.
2829
*/
29-
public class SnapshotCommand extends Command {
30+
public class SnapshotCommand extends StorageNfsVersionCommand {
3031
protected String primaryStoragePoolNameLabel;
3132
StorageFilerTO primaryPool;
3233
private String snapshotUuid;

core/src/com/cloud/agent/api/storage/CopyVolumeCommand.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919

2020
package com.cloud.agent.api.storage;
2121

22-
import com.cloud.agent.api.Command;
2322
import com.cloud.agent.api.to.StorageFilerTO;
2423
import com.cloud.storage.StoragePool;
2524

26-
public class CopyVolumeCommand extends Command {
25+
public class CopyVolumeCommand extends StorageNfsVersionCommand {
2726

2827
long volumeId;
2928
String volumePath;
@@ -32,7 +31,6 @@ public class CopyVolumeCommand extends Command {
3231
boolean toSecondaryStorage;
3332
String vmName;
3433
boolean executeInSequence = false;
35-
String nfsVersion;
3634

3735
public CopyVolumeCommand() {
3836
}
@@ -77,11 +75,4 @@ public String getVmName() {
7775
return vmName;
7876
}
7977

80-
public String getNfsVersion() {
81-
return nfsVersion;
82-
}
83-
84-
public void setNfsVersion(String nfsVersion) {
85-
this.nfsVersion = nfsVersion;
86-
}
8778
}

core/src/com/cloud/agent/api/storage/ListTemplateCommand.java

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,17 @@
2323

2424
public class ListTemplateCommand extends StorageCommand {
2525
private DataStoreTO store;
26-
private String nfsVersion;
27-
28-
//private String secUrl;
2926

3027
public ListTemplateCommand() {
3128
}
3229

3330
public ListTemplateCommand(DataStoreTO store) {
3431
this.store = store;
35-
// this.secUrl = url;
3632
}
3733

38-
public ListTemplateCommand(DataStoreTO store, String nfsVersion) {
34+
public ListTemplateCommand(DataStoreTO store, Integer nfsVersion) {
35+
super(nfsVersion);
3936
this.store = store;
40-
this.nfsVersion = nfsVersion;
4137
}
4238

4339
@Override
@@ -49,12 +45,4 @@ public DataStoreTO getDataStore() {
4945
return store;
5046
}
5147

52-
public String getNfsVersion() {
53-
return nfsVersion;
54-
}
55-
56-
// public String getSecUrl() {
57-
// return secUrl;
58-
// }
59-
6048
}

0 commit comments

Comments
 (0)