Skip to content

Commit e6cd47d

Browse files
author
Prachi Damle
committed
More changes for deployVM flow.
1 parent 94e8090 commit e6cd47d

24 files changed

Lines changed: 388 additions & 367 deletions

engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public String reserveVirtualMachine(VMEntityVO vmEntityVO, String plannerToUse,
154154

155155
}
156156

157-
DeploymentPlanner planner = ComponentContext.getCompanent(plannerToUse);
157+
DeploymentPlanner planner = ComponentContext.getComponent(plannerToUse);
158158
DeployDestination dest = null;
159159

160160
if (planner.canHandle(vmProfile, plan, exclude)) {

engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ClusterEntityImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import java.util.Map;
2424

2525
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
26-
import org.apache.cloudstack.engine.datacenter.entity.api.db.ClusterVO;
26+
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineClusterVO;
2727
import com.cloud.hypervisor.Hypervisor.HypervisorType;
2828
import com.cloud.org.Cluster.ClusterType;
2929
import com.cloud.org.Grouping.AllocationState;
@@ -36,7 +36,7 @@ public class ClusterEntityImpl implements ClusterEntity {
3636

3737
private DataCenterResourceManager manager;
3838

39-
private ClusterVO clusterVO;
39+
private EngineClusterVO clusterVO;
4040

4141

4242
public ClusterEntityImpl(String clusterId, DataCenterResourceManager manager) {

engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceManager.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,33 @@
1818

1919

2020
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
21-
import org.apache.cloudstack.engine.datacenter.entity.api.db.ClusterVO;
22-
import org.apache.cloudstack.engine.datacenter.entity.api.db.DataCenterVO;
23-
import org.apache.cloudstack.engine.datacenter.entity.api.db.HostPodVO;
24-
import org.apache.cloudstack.engine.datacenter.entity.api.db.HostVO;
21+
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineClusterVO;
22+
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineDataCenterVO;
23+
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostPodVO;
24+
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO;
2525

2626
import com.cloud.utils.fsm.NoTransitionException;
2727

2828

2929

3030
public interface DataCenterResourceManager {
3131

32-
DataCenterVO loadDataCenter(String dataCenterId);
32+
EngineDataCenterVO loadDataCenter(String dataCenterId);
3333

34-
void saveDataCenter(DataCenterVO dc);
34+
void saveDataCenter(EngineDataCenterVO dc);
3535

36-
void savePod(HostPodVO dc);
36+
void savePod(EngineHostPodVO dc);
3737

38-
void saveCluster(ClusterVO cluster);
38+
void saveCluster(EngineClusterVO cluster);
3939

4040
boolean changeState(DataCenterResourceEntity entity, Event event) throws NoTransitionException;
4141

42-
HostPodVO loadPod(String uuid);
42+
EngineHostPodVO loadPod(String uuid);
4343

44-
ClusterVO loadCluster(String uuid);
44+
EngineClusterVO loadCluster(String uuid);
4545

46-
HostVO loadHost(String uuid);
46+
EngineHostVO loadHost(String uuid);
4747

48-
void saveHost(HostVO hostVO);
48+
void saveHost(EngineHostVO hostVO);
4949

5050
}

engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceManagerImpl.java

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State;
2222
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
23-
import org.apache.cloudstack.engine.datacenter.entity.api.db.ClusterVO;
24-
import org.apache.cloudstack.engine.datacenter.entity.api.db.DataCenterVO;
25-
import org.apache.cloudstack.engine.datacenter.entity.api.db.HostPodVO;
26-
import org.apache.cloudstack.engine.datacenter.entity.api.db.HostVO;
27-
import org.apache.cloudstack.engine.datacenter.entity.api.db.dao.ClusterDao;
28-
import org.apache.cloudstack.engine.datacenter.entity.api.db.dao.DataCenterDao;
29-
import org.apache.cloudstack.engine.datacenter.entity.api.db.dao.HostDao;
30-
import org.apache.cloudstack.engine.datacenter.entity.api.db.dao.HostPodDao;
23+
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineClusterVO;
24+
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineDataCenterVO;
25+
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostPodVO;
26+
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO;
27+
import org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineClusterDao;
28+
import org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineDataCenterDao;
29+
import org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineHostDao;
30+
import org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineHostPodDao;
3131
import org.springframework.stereotype.Component;
3232

3333

@@ -39,31 +39,31 @@
3939
public class DataCenterResourceManagerImpl implements DataCenterResourceManager {
4040

4141
@Inject
42-
DataCenterDao _dataCenterDao;
42+
EngineDataCenterDao _dataCenterDao;
4343

4444
@Inject
45-
HostPodDao _podDao;
45+
EngineHostPodDao _podDao;
4646

4747
@Inject
48-
ClusterDao _clusterDao;
48+
EngineClusterDao _clusterDao;
4949

5050
@Inject
51-
HostDao _hostDao;
51+
EngineHostDao _hostDao;
5252

5353

5454
protected StateMachine2<State, Event, DataCenterResourceEntity> _stateMachine = DataCenterResourceEntity.State.s_fsm;
5555

5656
@Override
57-
public DataCenterVO loadDataCenter(String dataCenterId) {
58-
DataCenterVO dataCenterVO = _dataCenterDao.findByUuid(dataCenterId);
57+
public EngineDataCenterVO loadDataCenter(String dataCenterId) {
58+
EngineDataCenterVO dataCenterVO = _dataCenterDao.findByUuid(dataCenterId);
5959
if(dataCenterVO == null){
6060
throw new InvalidParameterValueException("Zone does not exist");
6161
}
6262
return dataCenterVO;
6363
}
6464

6565
@Override
66-
public void saveDataCenter(DataCenterVO dc) {
66+
public void saveDataCenter(EngineDataCenterVO dc) {
6767
_dataCenterDao.persist(dc);
6868

6969
}
@@ -85,44 +85,44 @@ public boolean changeState(DataCenterResourceEntity entity, Event event) throws
8585
}
8686

8787
@Override
88-
public HostPodVO loadPod(String uuid) {
89-
HostPodVO pod = _podDao.findByUuid(uuid);
88+
public EngineHostPodVO loadPod(String uuid) {
89+
EngineHostPodVO pod = _podDao.findByUuid(uuid);
9090
if(pod == null){
9191
throw new InvalidParameterValueException("Pod does not exist");
9292
}
9393
return pod;
9494
}
9595

9696
@Override
97-
public ClusterVO loadCluster(String uuid) {
98-
ClusterVO cluster = _clusterDao.findByUuid(uuid);
97+
public EngineClusterVO loadCluster(String uuid) {
98+
EngineClusterVO cluster = _clusterDao.findByUuid(uuid);
9999
if(cluster == null){
100100
throw new InvalidParameterValueException("Pod does not exist");
101101
}
102102
return cluster;
103103
}
104104

105105
@Override
106-
public void savePod(HostPodVO pod) {
106+
public void savePod(EngineHostPodVO pod) {
107107
_podDao.persist(pod);
108108
}
109109

110110
@Override
111-
public void saveCluster(ClusterVO cluster) {
111+
public void saveCluster(EngineClusterVO cluster) {
112112
_clusterDao.persist(cluster);
113113
}
114114

115115
@Override
116-
public HostVO loadHost(String uuid) {
117-
HostVO host = _hostDao.findByUuid(uuid);
116+
public EngineHostVO loadHost(String uuid) {
117+
EngineHostVO host = _hostDao.findByUuid(uuid);
118118
if(host == null){
119119
throw new InvalidParameterValueException("Host does not exist");
120120
}
121121
return host;
122122
}
123123

124124
@Override
125-
public void saveHost(HostVO hostVO) {
125+
public void saveHost(EngineHostVO hostVO) {
126126
_hostDao.persist(hostVO);
127127
}
128128

engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/HostEntityImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import java.util.Map;
2323

2424
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
25-
import org.apache.cloudstack.engine.datacenter.entity.api.db.HostVO;
25+
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO;
2626

2727
import com.cloud.hypervisor.Hypervisor.HypervisorType;
2828
import com.cloud.utils.fsm.NoTransitionException;
@@ -31,7 +31,7 @@ public class HostEntityImpl implements HostEntity {
3131

3232
private DataCenterResourceManager manager;
3333

34-
private HostVO hostVO;
34+
private EngineHostVO hostVO;
3535

3636
public HostEntityImpl(String uuid, DataCenterResourceManager manager) {
3737
this.manager = manager;

engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/PodEntityImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import java.util.Map;
2525

2626
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
27-
import org.apache.cloudstack.engine.datacenter.entity.api.db.HostPodVO;
27+
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostPodVO;
2828

2929
import com.cloud.org.Cluster;
3030
import com.cloud.org.Grouping.AllocationState;
@@ -35,7 +35,7 @@ public class PodEntityImpl implements PodEntity {
3535

3636
private DataCenterResourceManager manager;
3737

38-
private HostPodVO podVO;
38+
private EngineHostPodVO podVO;
3939

4040
public PodEntityImpl(String uuid, DataCenterResourceManager manager) {
4141
this.manager = manager;

engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ZoneEntityImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import javax.ws.rs.GET;
2727
import javax.ws.rs.Path;
2828
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
29-
import org.apache.cloudstack.engine.datacenter.entity.api.db.DataCenterVO;
29+
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineDataCenterVO;
3030
import com.cloud.utils.fsm.FiniteStateObject;
3131
import com.cloud.utils.fsm.NoTransitionException;
3232

@@ -37,7 +37,7 @@ public class ZoneEntityImpl implements ZoneEntity, FiniteStateObject<DataCenterR
3737

3838
private DataCenterResourceManager manager;
3939

40-
private DataCenterVO dataCenterVO;
40+
private EngineDataCenterVO dataCenterVO;
4141

4242

4343
public ZoneEntityImpl(String dataCenterId, DataCenterResourceManager manager) {

engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/ClusterVO.java renamed to engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineClusterVO.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
@Entity
4242
@Table(name="cluster")
43-
public class ClusterVO implements Cluster, Identity {
43+
public class EngineClusterVO implements Cluster, Identity {
4444

4545
@Id
4646
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -99,27 +99,27 @@ public class ClusterVO implements Cluster, Identity {
9999
*/
100100
@Enumerated(value=EnumType.STRING)
101101
@StateMachine(state=State.class, event=Event.class)
102-
@Column(name="state", updatable=true, nullable=false, length=32)
103-
protected State state = null;
102+
@Column(name="engine_state", updatable=true, nullable=false, length=32)
103+
protected State engineState = null;
104104

105105

106-
public ClusterVO() {
106+
public EngineClusterVO() {
107107
clusterType = Cluster.ClusterType.CloudManaged;
108108
allocationState = Grouping.AllocationState.Enabled;
109109

110110
this.uuid = UUID.randomUUID().toString();
111-
this.state = State.Disabled;
111+
this.engineState = State.Disabled;
112112
}
113113

114-
public ClusterVO(long dataCenterId, long podId, String name) {
114+
public EngineClusterVO(long dataCenterId, long podId, String name) {
115115
this.dataCenterId = dataCenterId;
116116
this.podId = podId;
117117
this.name = name;
118118
this.clusterType = Cluster.ClusterType.CloudManaged;
119119
this.allocationState = Grouping.AllocationState.Enabled;
120120
this.managedState = ManagedState.Managed;
121121
this.uuid = UUID.randomUUID().toString();
122-
this.state = State.Disabled;
122+
this.engineState = State.Disabled;
123123
}
124124

125125
@Override
@@ -169,7 +169,7 @@ public void setManagedState(ManagedState managedState) {
169169
this.managedState = managedState;
170170
}
171171

172-
public ClusterVO(long clusterId) {
172+
public EngineClusterVO(long clusterId) {
173173
this.id = clusterId;
174174
}
175175

@@ -180,10 +180,10 @@ public int hashCode() {
180180

181181
@Override
182182
public boolean equals(Object obj) {
183-
if (!(obj instanceof ClusterVO)) {
183+
if (!(obj instanceof EngineClusterVO)) {
184184
return false;
185185
}
186-
ClusterVO that = (ClusterVO)obj;
186+
EngineClusterVO that = (EngineClusterVO)obj;
187187
return this.id == that.id;
188188
}
189189

@@ -238,6 +238,6 @@ public Date getLastUpdated() {
238238
}
239239

240240
public State getState() {
241-
return state;
241+
return engineState;
242242
}
243243
}

engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/DataCenterVO.java renamed to engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineDataCenterVO.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
@Entity
4444
@Table(name="data_center")
45-
public class DataCenterVO implements DataCenter, Identity {
45+
public class EngineDataCenterVO implements DataCenter, Identity {
4646

4747
@Id
4848
@GeneratedValue(strategy=GenerationType.IDENTITY)
@@ -151,8 +151,8 @@ public class DataCenterVO implements DataCenter, Identity {
151151
*/
152152
@Enumerated(value=EnumType.STRING)
153153
@StateMachine(state=State.class, event=Event.class)
154-
@Column(name="state", updatable=true, nullable=false, length=32)
155-
protected State state = null;
154+
@Column(name="engine_state", updatable=true, nullable=false, length=32)
155+
protected State engineState = null;
156156

157157

158158
@Override
@@ -200,14 +200,14 @@ public void setFirewallProvider(String firewallProvider) {
200200
this.firewallProvider = firewallProvider;
201201
}
202202

203-
public DataCenterVO(long id, String name, String description, String dns1, String dns2, String dns3, String dns4, String guestCidr, String domain, Long domainId, NetworkType zoneType, String zoneToken, String domainSuffix) {
203+
public EngineDataCenterVO(long id, String name, String description, String dns1, String dns2, String dns3, String dns4, String guestCidr, String domain, Long domainId, NetworkType zoneType, String zoneToken, String domainSuffix) {
204204
this(name, description, dns1, dns2, dns3, dns4, guestCidr, domain, domainId, zoneType, zoneToken, domainSuffix, false, false);
205205
this.id = id;
206206
this.allocationState = Grouping.AllocationState.Enabled;
207207
this.uuid = UUID.randomUUID().toString();
208208
}
209209

210-
public DataCenterVO(String name, String description, String dns1, String dns2, String dns3, String dns4, String guestCidr, String domain, Long domainId, NetworkType zoneType, String zoneToken, String domainSuffix, boolean securityGroupEnabled, boolean localStorageEnabled) {
210+
public EngineDataCenterVO(String name, String description, String dns1, String dns2, String dns3, String dns4, String guestCidr, String domain, Long domainId, NetworkType zoneType, String zoneToken, String domainSuffix, boolean securityGroupEnabled, boolean localStorageEnabled) {
211211
this.name = name;
212212
this.description = description;
213213
this.dns1 = dns1;
@@ -240,7 +240,7 @@ public DataCenterVO(String name, String description, String dns1, String dns2, S
240240
this.zoneToken = zoneToken;
241241
this.domain = domainSuffix;
242242
this.uuid = UUID.randomUUID().toString();
243-
this.state = State.Disabled;
243+
this.engineState = State.Disabled;
244244
}
245245

246246
@Override
@@ -310,7 +310,7 @@ public String getInternalDns2() {
310310
return internalDns2;
311311
}
312312

313-
protected DataCenterVO() {
313+
protected EngineDataCenterVO() {
314314
}
315315

316316
@Override
@@ -421,10 +421,10 @@ public int hashCode() {
421421

422422
@Override
423423
public boolean equals(Object obj) {
424-
if (!(obj instanceof DataCenterVO)) {
424+
if (!(obj instanceof EngineDataCenterVO)) {
425425
return false;
426426
}
427-
DataCenterVO that = (DataCenterVO)obj;
427+
EngineDataCenterVO that = (EngineDataCenterVO)obj;
428428
return this.id == that.id;
429429
}
430430

@@ -475,6 +475,6 @@ public Date getLastUpdated() {
475475
}
476476

477477
public State getState() {
478-
return state;
478+
return engineState;
479479
}
480480
}

0 commit comments

Comments
 (0)