Skip to content

Commit 95fe42c

Browse files
committed
Migration work
1 parent c0febea commit 95fe42c

16 files changed

Lines changed: 487 additions & 278 deletions

File tree

api/src/org/apache/cloudstack/jobs/JobInfo.java

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,20 @@
2323

2424
public interface JobInfo extends Identity, InternalIdentity {
2525
public enum Status {
26-
IN_PROGRESS,
27-
SUCCEEDED,
28-
FAILED,
29-
CANCELLED;
26+
IN_PROGRESS(false),
27+
SUCCEEDED(true),
28+
FAILED(true),
29+
CANCELLED(true);
30+
31+
private final boolean done;
32+
33+
private Status(boolean done) {
34+
this.done = done;
35+
}
36+
37+
public boolean done() {
38+
return done;
39+
}
3040
}
3141

3242
String getType();

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,28 @@ public class StopCommand extends RebootCommand {
2323
private boolean isProxy=false;
2424
private String urlPort=null;
2525
private String publicConsoleProxyIpAddress=null;
26+
private boolean cleanupOnly;
2627

2728
protected StopCommand() {
2829
}
2930

30-
public StopCommand(VirtualMachine vm, boolean isProxy, String urlPort, String publicConsoleProxyIpAddress) {
31+
public StopCommand(VirtualMachine vm, boolean isProxy, String urlPort, String publicConsoleProxyIpAddress, boolean cleanupOnly) {
3132
super(vm);
3233
this.isProxy = isProxy;
3334
this.urlPort = urlPort;
3435
this.publicConsoleProxyIpAddress = publicConsoleProxyIpAddress;
36+
this.cleanupOnly = cleanupOnly;
3537
}
3638

3739
public StopCommand(VirtualMachine vm, String vnet) {
3840
super(vm);
3941
this.vnet = vnet;
4042
}
4143

44+
public boolean isCleanupOnly() {
45+
return cleanupOnly;
46+
}
47+
4248
public StopCommand(VirtualMachine vm) {
4349
super(vm);
4450
}
@@ -57,15 +63,15 @@ public boolean executeInSequence() {
5763
}
5864

5965
public boolean isProxy() {
60-
return this.isProxy;
66+
return isProxy;
6167
}
6268

6369
public String getURLPort() {
64-
return this.urlPort;
70+
return urlPort;
6571
}
6672

6773
public String getPublicConsoleProxyIpAddress() {
68-
return this.publicConsoleProxyIpAddress;
74+
return publicConsoleProxyIpAddress;
6975
}
7076

7177
}

engine/components-api/src/com/cloud/vm/VirtualMachineManager.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ boolean destroy(String vmUuid) throws ResourceUnavailableException, OperationTim
137137

138138
boolean migrateAway(VirtualMachine.Type type, long vmid, long hostId) throws InsufficientServerCapacityException, VirtualMachineMigrationException;
139139

140-
VirtualMachine migrate(String vmUuid, long srcHostId, DeployDestination dest) throws ResourceUnavailableException, ConcurrentOperationException, ManagementServerException,
141-
VirtualMachineMigrationException;
140+
Outcome<VirtualMachine> migrate(String vmUuid, long srcHostId, DeployDestination dest);
142141

143142
VirtualMachine migrateWithStorage(String vmUuid, long srcId, long destId, Map<Volume, StoragePool> volumeToPool) throws ResourceUnavailableException,
144143
ConcurrentOperationException, ManagementServerException, VirtualMachineMigrationException;

engine/components-api/src/com/cloud/vm/VmWork.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,22 @@ public class VmWork {
2121
long accountId;
2222
long vmId;
2323

24-
public VmWork() {
24+
public VmWork(long userId, long accountId, long vmId) {
25+
this.userId = userId;
26+
this.accountId = accountId;
27+
this.vmId = vmId;
2528
}
2629

2730
public long getUserId() {
2831
return userId;
2932
}
3033

31-
public void setUserId(long userId) {
32-
this.userId = userId;
33-
}
34-
3534
public long getAccountId() {
3635
return accountId;
3736
}
3837

39-
public void setAccountId(long accountId) {
40-
this.accountId = accountId;
41-
}
42-
4338
public long getVmId() {
4439
return vmId;
4540
}
4641

47-
public void setVmId(long vmId) {
48-
this.vmId = vmId;
49-
}
5042
}

0 commit comments

Comments
 (0)