mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
latest changes
This commit is contained in:
parent
298d224f83
commit
06b7d80fec
@ -293,5 +293,4 @@ public interface VirtualMachine extends RunningOn, ControlledEntity, Identity, S
|
||||
|
||||
public Map<String, String> getDetails();
|
||||
|
||||
boolean canPlugNics();
|
||||
}
|
||||
|
||||
@ -164,63 +164,63 @@ public class DomainRouterVO extends VMInstanceVO implements VirtualRouter {
|
||||
return publicIpAddress;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Role getRole() {
|
||||
return role;
|
||||
}
|
||||
@Override
|
||||
public Role getRole() {
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(Role role) {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRedundantRouter() {
|
||||
return this.isRedundantRouter;
|
||||
}
|
||||
|
||||
public void setIsRedundantRouter(boolean isRedundantRouter) {
|
||||
this.isRedundantRouter = isRedundantRouter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getServiceOfferingId() {
|
||||
return serviceOfferingId;
|
||||
}
|
||||
|
||||
public int getPriority() {
|
||||
return this.priority;
|
||||
}
|
||||
|
||||
public void setPriority(int priority) {
|
||||
this.priority = priority;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedundantState getRedundantState() {
|
||||
return this.redundantState;
|
||||
}
|
||||
|
||||
public void setRedundantState(RedundantState redundantState) {
|
||||
this.redundantState = redundantState;
|
||||
}
|
||||
|
||||
public boolean getIsPriorityBumpUp() {
|
||||
return this.isPriorityBumpUp;
|
||||
}
|
||||
|
||||
public void setIsPriorityBumpUp(boolean isPriorityBumpUp) {
|
||||
this.isPriorityBumpUp = isPriorityBumpUp;
|
||||
}
|
||||
public void setRole(Role role) {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStopPending() {
|
||||
return this.stopPending;
|
||||
}
|
||||
public boolean getIsRedundantRouter() {
|
||||
return this.isRedundantRouter;
|
||||
}
|
||||
|
||||
public void setIsRedundantRouter(boolean isRedundantRouter) {
|
||||
this.isRedundantRouter = isRedundantRouter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStopPending(boolean stopPending) {
|
||||
this.stopPending = stopPending;
|
||||
}
|
||||
public long getServiceOfferingId() {
|
||||
return serviceOfferingId;
|
||||
}
|
||||
|
||||
public int getPriority() {
|
||||
return this.priority;
|
||||
}
|
||||
|
||||
public void setPriority(int priority) {
|
||||
this.priority = priority;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedundantState getRedundantState() {
|
||||
return this.redundantState;
|
||||
}
|
||||
|
||||
public void setRedundantState(RedundantState redundantState) {
|
||||
this.redundantState = redundantState;
|
||||
}
|
||||
|
||||
public boolean getIsPriorityBumpUp() {
|
||||
return this.isPriorityBumpUp;
|
||||
}
|
||||
|
||||
public void setIsPriorityBumpUp(boolean isPriorityBumpUp) {
|
||||
this.isPriorityBumpUp = isPriorityBumpUp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStopPending() {
|
||||
return this.stopPending;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStopPending(boolean stopPending) {
|
||||
this.stopPending = stopPending;
|
||||
}
|
||||
|
||||
public String getTemplateVersion() {
|
||||
return this.templateVersion;
|
||||
@ -243,8 +243,4 @@ public class DomainRouterVO extends VMInstanceVO implements VirtualRouter {
|
||||
return vpcId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlugNics() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -48,13 +48,13 @@ import com.cloud.vm.VirtualMachine.State;
|
||||
@Inheritance(strategy=InheritanceType.JOINED)
|
||||
@DiscriminatorColumn(name="type", discriminatorType=DiscriminatorType.STRING, length=32)
|
||||
public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, VirtualMachine.Event> {
|
||||
@Id
|
||||
@Id
|
||||
@TableGenerator(name="vm_instance_sq", table="sequence", pkColumnName="name", valueColumnName="value", pkColumnValue="vm_instance_seq", allocationSize=1)
|
||||
@Column(name="id", updatable=false, nullable = false)
|
||||
protected long id;
|
||||
protected long id;
|
||||
|
||||
@Column(name="name", updatable=false, nullable=false, length=255)
|
||||
protected String hostName = null;
|
||||
protected String hostName = null;
|
||||
|
||||
@Encrypt
|
||||
@Column(name="vnc_password", updatable=true, nullable=false, length=255)
|
||||
@ -78,19 +78,19 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
|
||||
protected State state = null;
|
||||
|
||||
@Column(name="private_ip_address", updatable=true)
|
||||
protected String privateIpAddress;
|
||||
protected String privateIpAddress;
|
||||
|
||||
@Column(name="instance_name", updatable=true, nullable=false)
|
||||
protected String instanceName;
|
||||
|
||||
@Column(name="vm_template_id", updatable=true, nullable=true, length=17)
|
||||
protected Long templateId = new Long(-1);
|
||||
protected Long templateId = new Long(-1);
|
||||
|
||||
@Column(name="guest_os_id", nullable=false, length=17)
|
||||
protected long guestOSId;
|
||||
|
||||
@Column(name="host_id", updatable=true, nullable=true)
|
||||
protected Long hostId;
|
||||
protected Long hostId;
|
||||
|
||||
@Column(name="last_host_id", updatable=true, nullable=true)
|
||||
protected Long lastHostId;
|
||||
@ -143,6 +143,15 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
|
||||
@Enumerated(value=EnumType.STRING)
|
||||
protected HypervisorType hypervisorType;
|
||||
|
||||
@Column(name="ram")
|
||||
protected long ram;
|
||||
|
||||
@Column(name="cpu")
|
||||
protected int cpu;
|
||||
|
||||
@Column(name="tags")
|
||||
protected String tags;
|
||||
|
||||
@Transient
|
||||
Map<String, String> details;
|
||||
|
||||
@ -151,16 +160,16 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
|
||||
;
|
||||
|
||||
public VMInstanceVO(long id,
|
||||
long serviceOfferingId,
|
||||
String name,
|
||||
String instanceName,
|
||||
Type type,
|
||||
Long vmTemplateId,
|
||||
HypervisorType hypervisorType,
|
||||
long guestOSId,
|
||||
long domainId,
|
||||
long accountId,
|
||||
boolean haEnabled) {
|
||||
long serviceOfferingId,
|
||||
String name,
|
||||
String instanceName,
|
||||
Type type,
|
||||
Long vmTemplateId,
|
||||
HypervisorType hypervisorType,
|
||||
long guestOSId,
|
||||
long domainId,
|
||||
long accountId,
|
||||
boolean haEnabled) {
|
||||
this.id = id;
|
||||
this.hostName = name != null ? name : this.uuid;
|
||||
if (vmTemplateId != null) {
|
||||
@ -191,7 +200,7 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
|
||||
long accountId,
|
||||
boolean haEnabled,
|
||||
boolean limitResourceUse) {
|
||||
this(id, serviceOfferingId, name, instanceName, type, vmTemplateId, hypervisorType, guestOSId, domainId, accountId, haEnabled);
|
||||
this(id, serviceOfferingId, name, instanceName, type, vmTemplateId, hypervisorType, guestOSId, domainId, accountId, haEnabled);
|
||||
this.limitCpuUse = limitResourceUse;
|
||||
}
|
||||
|
||||
@ -199,7 +208,7 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
|
||||
}
|
||||
|
||||
public Date getRemoved() {
|
||||
return removed;
|
||||
return removed;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -218,71 +227,71 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
|
||||
}
|
||||
|
||||
public long getUpdated() {
|
||||
return updated;
|
||||
return updated;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
@Override
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public HypervisorType getHypervisorType() {
|
||||
return hypervisorType;
|
||||
}
|
||||
return hypervisorType;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public Date getCreated() {
|
||||
return created;
|
||||
}
|
||||
return created;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public long getDataCenterIdToDeployIn() {
|
||||
return dataCenterIdToDeployIn;
|
||||
}
|
||||
return dataCenterIdToDeployIn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHostName() {
|
||||
return hostName;
|
||||
}
|
||||
@Override
|
||||
public String getHostName() {
|
||||
return hostName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInstanceName() {
|
||||
return instanceName;
|
||||
}
|
||||
@Override
|
||||
public String getInstanceName() {
|
||||
return instanceName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public State getState() {
|
||||
return state;
|
||||
}
|
||||
@Override
|
||||
public State getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
// don't use this directly, use VM state machine instead, this method is added for migration tool only
|
||||
@Override
|
||||
// don't use this directly, use VM state machine instead, this method is added for migration tool only
|
||||
@Override
|
||||
public void setState(State state) {
|
||||
this.state = state;
|
||||
}
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPrivateIpAddress() {
|
||||
return privateIpAddress;
|
||||
}
|
||||
@Override
|
||||
public String getPrivateIpAddress() {
|
||||
return privateIpAddress;
|
||||
}
|
||||
|
||||
public void setPrivateIpAddress(String address) {
|
||||
privateIpAddress = address;
|
||||
}
|
||||
public void setPrivateIpAddress(String address) {
|
||||
privateIpAddress = address;
|
||||
}
|
||||
|
||||
public void setVncPassword(String vncPassword) {
|
||||
this.vncPassword = vncPassword;
|
||||
@ -298,69 +307,69 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
|
||||
return serviceOfferingId;
|
||||
}
|
||||
|
||||
public Long getProxyId() {
|
||||
return proxyId;
|
||||
public Long getProxyId() {
|
||||
return proxyId;
|
||||
}
|
||||
|
||||
public void setProxyId(Long proxyId) {
|
||||
this.proxyId = proxyId;
|
||||
this.proxyId = proxyId;
|
||||
}
|
||||
|
||||
public Date getProxyAssignTime() {
|
||||
return this.proxyAssignTime;
|
||||
return this.proxyAssignTime;
|
||||
}
|
||||
|
||||
public void setProxyAssignTime(Date time) {
|
||||
this.proxyAssignTime = time;
|
||||
this.proxyAssignTime = time;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTemplateId() {
|
||||
if (templateId == null) {
|
||||
@Override
|
||||
public long getTemplateId() {
|
||||
if (templateId == null) {
|
||||
return -1;
|
||||
} else {
|
||||
return templateId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setTemplateId(Long templateId) {
|
||||
this.templateId = templateId;
|
||||
}
|
||||
public void setTemplateId(Long templateId) {
|
||||
this.templateId = templateId;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public long getGuestOSId() {
|
||||
return guestOSId;
|
||||
}
|
||||
return guestOSId;
|
||||
}
|
||||
|
||||
public void setGuestOSId(long guestOSId) {
|
||||
this.guestOSId = guestOSId;
|
||||
}
|
||||
public void setGuestOSId(long guestOSId) {
|
||||
this.guestOSId = guestOSId;
|
||||
}
|
||||
|
||||
public void incrUpdated() {
|
||||
updated++;
|
||||
}
|
||||
public void incrUpdated() {
|
||||
updated++;
|
||||
}
|
||||
|
||||
public void decrUpdated() {
|
||||
updated--;
|
||||
}
|
||||
public void decrUpdated() {
|
||||
updated--;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getHostId() {
|
||||
return hostId;
|
||||
}
|
||||
@Override
|
||||
public Long getHostId() {
|
||||
return hostId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getLastHostId() {
|
||||
return lastHostId;
|
||||
}
|
||||
@Override
|
||||
public Long getLastHostId() {
|
||||
return lastHostId;
|
||||
}
|
||||
|
||||
public void setLastHostId(Long lastHostId) {
|
||||
this.lastHostId = lastHostId;
|
||||
}
|
||||
this.lastHostId = lastHostId;
|
||||
}
|
||||
|
||||
public void setHostId(Long hostId) {
|
||||
this.hostId = hostId;
|
||||
}
|
||||
public void setHostId(Long hostId) {
|
||||
this.hostId = hostId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHaEnabled() {
|
||||
@ -373,7 +382,7 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
|
||||
}
|
||||
|
||||
public void setLimitCpuUse(boolean value) {
|
||||
limitCpuUse = value;
|
||||
limitCpuUse = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -406,13 +415,13 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
|
||||
haEnabled = value;
|
||||
}
|
||||
|
||||
public void setReservationId(String reservationId) {
|
||||
this.reservationId = reservationId;
|
||||
}
|
||||
public void setReservationId(String reservationId) {
|
||||
this.reservationId = reservationId;
|
||||
}
|
||||
|
||||
public String getReservationId() {
|
||||
return this.reservationId;
|
||||
}
|
||||
public String getReservationId() {
|
||||
return this.reservationId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getDetails() {
|
||||
@ -429,9 +438,9 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
|
||||
this.details = details;
|
||||
}
|
||||
|
||||
transient String toString;
|
||||
transient String toString;
|
||||
@Override
|
||||
public String toString() {
|
||||
public String toString() {
|
||||
if (toString == null) {
|
||||
toString = new StringBuilder("VM[").append(type.toString()).append("|").append(hostName).append("]").toString();
|
||||
}
|
||||
@ -440,35 +449,30 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + (int) (id ^ (id >>> 32));
|
||||
return result;
|
||||
}
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + (int) (id ^ (id >>> 32));
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
VMInstanceVO other = (VMInstanceVO) obj;
|
||||
if (id != other.id)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
VMInstanceVO other = (VMInstanceVO) obj;
|
||||
if (id != other.id)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void setServiceOfferingId(long serviceOfferingId) {
|
||||
this.serviceOfferingId = serviceOfferingId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlugNics() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -22,10 +22,11 @@ import java.net.URL;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.cloudstack.platform.cloud.entity.api.VirtualMachineEntity;
|
||||
import org.apache.cloudstack.platform.cloud.entity.api.VolumeEntity;
|
||||
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.hypervisor.Hypervisor;
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
|
||||
public interface OrchestrationService {
|
||||
/**
|
||||
@ -43,7 +44,7 @@ public interface OrchestrationService {
|
||||
* @param details extra details to store for the VM
|
||||
* @return VirtualMachine
|
||||
*/
|
||||
VirtualMachine create(String name,
|
||||
VirtualMachineEntity create(String name,
|
||||
String template,
|
||||
String hostName,
|
||||
int cpu,
|
||||
@ -55,7 +56,7 @@ public interface OrchestrationService {
|
||||
Map<String, String> details,
|
||||
String owner);
|
||||
|
||||
VirtualMachine createFromScratch(String uuid,
|
||||
VirtualMachineEntity createFromScratch(String uuid,
|
||||
String iso,
|
||||
String os,
|
||||
String hypervisor,
|
||||
@ -77,8 +78,6 @@ public interface OrchestrationService {
|
||||
*/
|
||||
String reserve(String vm, String planner, Long until) throws InsufficientCapacityException;
|
||||
|
||||
String cancel(String reservationId);
|
||||
|
||||
/**
|
||||
* Deploy the reservation
|
||||
* @param reservationId reservation id during the deployment
|
||||
@ -87,29 +86,13 @@ public interface OrchestrationService {
|
||||
*/
|
||||
String deploy(String reservationId);
|
||||
|
||||
/**
|
||||
* Stops the vm
|
||||
* @param vm vm
|
||||
* @throws CloudRuntimeException if error
|
||||
*/
|
||||
String stop(String vm);
|
||||
|
||||
/**
|
||||
* destroys the vm
|
||||
* @param vm vm
|
||||
* @throws CloudRuntimeException if error
|
||||
*/
|
||||
void destroy(String vm);
|
||||
|
||||
void joinNetwork(String network1, String network2);
|
||||
|
||||
void attachVolume(String vm, String vol);
|
||||
|
||||
void createNetwork();
|
||||
|
||||
void destroyNetwork();
|
||||
|
||||
void createVolume();
|
||||
VolumeEntity createVolume();
|
||||
|
||||
void registerTemplate(String name, URL path, String os, Hypervisor hypervisor);
|
||||
}
|
||||
|
||||
@ -1,10 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
|
||||
<classpathentry including="**/*.java" kind="src" path="src"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/api"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/platform-api"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/platform-planning"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/framework-ipc"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/cloud-framework-ipc"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/cloud-platform-api"/>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
|
||||
@ -10,8 +10,14 @@
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
||||
|
||||
4
platform/orchestration/.settings/org.eclipse.m2e.core.prefs
Executable file
4
platform/orchestration/.settings/org.eclipse.m2e.core.prefs
Executable file
@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
6
platform/orchestration/pom.xml
Executable file
6
platform/orchestration/pom.xml
Executable file
@ -0,0 +1,6 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.apache.cloudstack</groupId>
|
||||
<artifactId>cloud-platform-orchestration</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</project>
|
||||
@ -22,140 +22,58 @@ import java.net.URL;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.cloudstack.framework.ipc.Publisher;
|
||||
import org.apache.cloudstack.platform.planning.Concierge;
|
||||
import org.apache.cloudstack.platform.cloud.entity.api.VirtualMachineEntity;
|
||||
import org.apache.cloudstack.platform.cloud.entity.api.VolumeEntity;
|
||||
import org.apache.cloudstack.platform.service.api.OrchestrationService;
|
||||
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.hypervisor.Hypervisor;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
|
||||
|
||||
public class CloudOrchestrator implements OrchestrationService {
|
||||
int _retryCount = 5;
|
||||
Concierge _concierge = null; // These are injected
|
||||
Publisher _publisher = null;
|
||||
|
||||
@Override
|
||||
public VirtualMachine create(String uuid, String template, String hostName, int cpu, int speed, long memory, List<String> networks, List<String> rootDiskTags, List<String> computeTags, Map<String, String> details,
|
||||
String owner) {
|
||||
// creates a virtual machine and relevant work in database
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VirtualMachine createFromScratch(String uuid, String iso, String os, String hypervisor, String hostName, int cpu, int speed, long memory, List<String> networks, List<String> computeTags,
|
||||
public VirtualMachineEntity create(String name, String template, String hostName, int cpu, int speed, long memory, List<String> networks, List<String> rootDiskTags, List<String> computeTags,
|
||||
Map<String, String> details, String owner) {
|
||||
// creates a virtual machine and relevant work in database
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public VirtualMachineEntity createFromScratch(String uuid, String iso, String os, String hypervisor, String hostName, int cpu, int speed, long memory, List<String> networks, List<String> computeTags,
|
||||
Map<String, String> details, String owner) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String reserve(String vm, String planner, Long until) throws InsufficientCapacityException {
|
||||
return _concierge.reserve(vm, planner);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String cancel(String reservationId) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String deploy(String reservationId, String callback) {
|
||||
for (int i = 0; i < _retryCount; i++) {
|
||||
try {
|
||||
// Retrieves the reservation
|
||||
// Signals Network and Storage to prepare
|
||||
// Signals Compute
|
||||
_concierge.claim(reservationId);
|
||||
} catch (Exception e) {
|
||||
// Cancel reservations.
|
||||
}
|
||||
_concierge.reserveAnother(reservationId);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String stop(String vm) {
|
||||
|
||||
public String deploy(String reservationId) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy(String vm) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void joinNetwork(String network1, String network2) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attachNetwork(String network, String vm) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detachNetwork(String network, String vm) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attachVolume(String vm, String vol) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createNetwork() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroyNetwork() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createVolume() {
|
||||
public VolumeEntity createVolume() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroyVolume() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void snapshotVirtualMachine(String vm) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void snapshotVolume(String volume) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backup(String snapshot) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerTemplate(String name, URL path, String os, Hypervisor hypervisor) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
@ -131,7 +131,7 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker {
|
||||
|
||||
_upgradeMap.put("2.2.8", new DbUpgrade[] { new Upgrade228to229(), new Upgrade229to2210(), new Upgrade2210to2211(),
|
||||
new Upgrade2211to2212(), new Upgrade2212to2213(), new Upgrade2213to2214(), new Upgrade2214to30()
|
||||
, new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40() });
|
||||
, new Upgrade30to301(), new Upgrade301to302(), new Upgrade302to40() });
|
||||
|
||||
_upgradeMap.put("2.2.9", new DbUpgrade[] { new Upgrade229to2210(), new Upgrade2210to2211(), new Upgrade2211to2212(),
|
||||
new Upgrade2212to2213(), new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(),
|
||||
@ -335,7 +335,7 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker {
|
||||
}
|
||||
|
||||
if ( currentVersion == null )
|
||||
return;
|
||||
return;
|
||||
|
||||
s_logger.info("DB version = " + dbVersion + " Code Version = " + currentVersion);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user