Skip to content

Commit 8d4c836

Browse files
nvazquezrohityadavcloud
authored andcommitted
shapeblue10: live storage and VM migration (#11)
shapeblue10 (A1): qcow2 vs db discrepancy resulting in full clone becoming linked shapeblue10 (A2): iso attached VM migration regression shapeblue10 (B): create stub based full clone migration without needing snapshot
1 parent aa03bbb commit 8d4c836

File tree

15 files changed

+428
-132
lines changed

15 files changed

+428
-132
lines changed

api/src/com/cloud/storage/MigrationOptions.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public class MigrationOptions implements Serializable {
2828
private String srcBackingFilePath;
2929
private String backingFile;
3030
private boolean copySrcTemplate;
31-
private String snapshotName;
3231
private String srcVolumeUuid;
3332
private int timeout;
3433

@@ -49,11 +48,10 @@ public MigrationOptions(String srcPoolUuid, Storage.StoragePoolType srcPoolType,
4948
this.backingFile = backingFile;
5049
}
5150

52-
public MigrationOptions(String srcPoolUuid, Storage.StoragePoolType srcPoolType, String snapshotName, String srcVolumeUuid) {
51+
public MigrationOptions(String srcPoolUuid, Storage.StoragePoolType srcPoolType, String srcVolumeUuid) {
5352
this.srcPoolUuid = srcPoolUuid;
5453
this.srcPoolType = srcPoolType;
5554
this.type = Type.FullClone;
56-
this.snapshotName = snapshotName;
5755
this.srcVolumeUuid = srcVolumeUuid;
5856
}
5957

@@ -73,10 +71,6 @@ public boolean isCopySrcTemplate() {
7371
return copySrcTemplate;
7472
}
7573

76-
public String getSnapshotName() {
77-
return snapshotName;
78-
}
79-
8074
public String getSrcVolumeUuid() {
8175
return srcVolumeUuid;
8276
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//
2+
// Licensed to the Apache Software Foundation (ASF) under one
3+
// or more contributor license agreements. See the NOTICE file
4+
// distributed with this work for additional information
5+
// regarding copyright ownership. The ASF licenses this file
6+
// to you under the Apache License, Version 2.0 (the
7+
// "License"); you may not use this file except in compliance
8+
// with the License. You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing,
13+
// software distributed under the License is distributed on an
14+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
// KIND, either express or implied. See the License for the
16+
// specific language governing permissions and limitations
17+
// under the License.
18+
//
19+
20+
package com.cloud.agent.api.storage;
21+
22+
import com.cloud.agent.api.Answer;
23+
24+
public class ListVolumeBackingInformationAnswer extends Answer {
25+
26+
private String backingFile;
27+
28+
public ListVolumeBackingInformationAnswer(String backingFile) {
29+
super();
30+
this.backingFile = backingFile;
31+
}
32+
33+
public String getBackingFile() {
34+
return backingFile;
35+
}
36+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
//
2+
// Licensed to the Apache Software Foundation (ASF) under one
3+
// or more contributor license agreements. See the NOTICE file
4+
// distributed with this work for additional information
5+
// regarding copyright ownership. The ASF licenses this file
6+
// to you under the Apache License, Version 2.0 (the
7+
// "License"); you may not use this file except in compliance
8+
// with the License. You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing,
13+
// software distributed under the License is distributed on an
14+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
// KIND, either express or implied. See the License for the
16+
// specific language governing permissions and limitations
17+
// under the License.
18+
//
19+
20+
package com.cloud.agent.api.storage;
21+
22+
import com.cloud.storage.Storage.StoragePoolType;
23+
import org.apache.cloudstack.storage.command.StorageSubSystemCommand;
24+
25+
public class ListVolumeBackingInformationCommand extends StorageSubSystemCommand {
26+
27+
private String volumePath;
28+
private String poolUuid;
29+
private StoragePoolType poolType;
30+
private boolean inSeq;
31+
32+
public ListVolumeBackingInformationCommand(final String volumePath, final String poolUuid, final StoragePoolType poolType) {
33+
this.volumePath = volumePath;
34+
this.poolUuid = poolUuid;
35+
this.poolType = poolType;
36+
}
37+
38+
public String getVolumePath() {
39+
return volumePath;
40+
}
41+
42+
public String getPoolUuid() {
43+
return poolUuid;
44+
}
45+
46+
public StoragePoolType getPoolType() {
47+
return poolType;
48+
}
49+
50+
@Override
51+
public void setExecuteInSequence(boolean inSeq) {
52+
this.inSeq = inSeq;
53+
}
54+
55+
@Override
56+
public boolean executeInSequence() {
57+
return inSeq;
58+
}
59+
}

core/src/com/cloud/storage/resource/StorageProcessor.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
package com.cloud.storage.resource;
2121

22+
import com.cloud.agent.api.storage.ListVolumeBackingInformationCommand;
2223
import org.apache.cloudstack.storage.command.AttachCommand;
2324
import org.apache.cloudstack.storage.command.CopyCommand;
2425
import org.apache.cloudstack.storage.command.CreateObjectCommand;
@@ -71,4 +72,6 @@ public interface StorageProcessor {
7172
public Answer snapshotAndCopy(SnapshotAndCopyCommand cmd);
7273

7374
public Answer resignature(ResignatureCommand cmd);
75+
76+
Answer listVolumeBackingInformation(ListVolumeBackingInformationCommand cmd);
7477
}

core/src/com/cloud/storage/resource/StorageSubsystemCommandHandlerBase.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
package com.cloud.storage.resource;
2121

22+
import com.cloud.agent.api.storage.ListVolumeBackingInformationCommand;
2223
import org.apache.log4j.Logger;
2324

2425
import org.apache.cloudstack.storage.command.AttachCommand;
@@ -67,6 +68,8 @@ public Answer handleStorageCommands(StorageSubSystemCommand command) {
6768
return processor.snapshotAndCopy((SnapshotAndCopyCommand)command);
6869
} else if (command instanceof ResignatureCommand) {
6970
return processor.resignature((ResignatureCommand)command);
71+
} else if (command instanceof ListVolumeBackingInformationCommand) {
72+
return processor.listVolumeBackingInformation((ListVolumeBackingInformationCommand) command);
7073
}
7174

7275
return new Answer((Command)command, false, "not implemented yet");

engine/components-api/src/com/cloud/storage/StorageManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public interface StorageManager extends StorageService {
5353
ConfigKey<Integer> KvmStorageOnlineMigrationWait = new ConfigKey<>(Integer.class,
5454
"kvm.storage.online.migration.wait",
5555
"Storage",
56-
"10800",
56+
"86400",
5757
"Timeout in seconds for online (live) storage migration to complete on KVM (migrateVirtualMachineWithVolume)",
5858
true,
5959
ConfigKey.Scope.Global,

0 commit comments

Comments
 (0)