Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ public class VirtualMachineTO {
String vncAddr;
Map<String, String> params;
String uuid;
String bootType;
String bootMode;

DiskTO[] disks;
NicTO[] nics;
Expand Down Expand Up @@ -382,15 +380,4 @@ public Pair<String, List<OVFPropertyTO>> getOvfProperties() {
public void setOvfProperties(Pair<String, List<OVFPropertyTO>> ovfProperties) {
this.ovfProperties = ovfProperties;
}
public String getBootType() {
return bootType;
}

public void setBootType(String bootType) {
this.bootType = bootType;
}

public String getBootMode() { return bootMode; }

public void setBootMode(String bootMode) { this.bootMode = bootMode; }
}
1 change: 0 additions & 1 deletion api/src/main/java/com/cloud/host/Host.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public static String[] toStrings(Host.Type... types) {
return strs;
}
}
public static final String HOST_UEFI_ENABLE = "host.uefi.enable";

/**
* @return name of the machine.
Expand Down
3 changes: 0 additions & 3 deletions api/src/main/java/com/cloud/vm/VirtualMachineProfile.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ public static class Param {
public static final Param PxeSeverType = new Param("PxeSeverType");
public static final Param HaTag = new Param("HaTag");
public static final Param HaOperation = new Param("HaOperation");
public static final Param UefiFlag = new Param("UefiFlag");
public static final Param BootMode = new Param("BootMode");
public static final Param BootType = new Param("BootType");

private String name;

Expand Down
1 change: 0 additions & 1 deletion api/src/main/java/com/cloud/vm/VmDetailConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public interface VmDetailConstants {
String KEYBOARD = "keyboard";
String CPU_CORE_PER_SOCKET = "cpu.corespersocket";
String ROOT_DISK_SIZE = "rootdisksize";
String BOOT_MODE = "boot.mode";

// VMware specific
String NIC_ADAPTER = "nicAdapter";
Expand Down
21 changes: 0 additions & 21 deletions api/src/main/java/org/apache/cloudstack/api/ApiConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -804,27 +804,6 @@ public class ApiConstants {
public static final String NODE_ROOT_DISK_SIZE = "noderootdisksize";
public static final String SUPPORTS_HA = "supportsha";

public static final String BOOT_TYPE ="boottype";
public static final String BOOT_MODE ="bootmode";

public enum BootType {
UEFI, BIOS;

@Override
public String toString() {
return this.name();
}
}

public enum BootMode {
LEGACY, SECURE;

@Override
public String toString() {
return this.name();
}
}

public enum HostDetails {
all, capacity, events, stats, min;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package org.apache.cloudstack.api.command.user.vm;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
Expand All @@ -27,8 +26,6 @@

import javax.annotation.Nonnull;

import com.cloud.utils.StringUtils;

import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.affinity.AffinityGroupResponse;
import org.apache.cloudstack.api.ACL;
Expand Down Expand Up @@ -113,12 +110,6 @@ public class DeployVMCmd extends BaseAsyncCreateCustomIdCmd implements SecurityG
@Parameter(name = ApiConstants.NETWORK_IDS, type = CommandType.LIST, collectionType = CommandType.UUID, entityType = NetworkResponse.class, description = "list of network ids used by virtual machine. Can't be specified with ipToNetworkList parameter")
private List<Long> networkIds;

@Parameter(name = ApiConstants.BOOT_TYPE, type = CommandType.STRING, required = false, description = "Guest VM Boot option either custom[UEFI] or default boot [BIOS]")
private String bootType;

@Parameter(name = ApiConstants.BOOT_MODE, type = CommandType.STRING, required = false, description = "Boot Mode [Legacy] or [Secure] Applicable when Boot Type Selected is UEFI, otherwise Legacy By default for BIOS")
private String bootMode;

//DataDisk information
@ACL
@Parameter(name = ApiConstants.DISK_OFFERING_ID, type = CommandType.UUID, entityType = DiskOfferingResponse.class, description = "the ID of the disk offering for the virtual machine. If the template is of ISO format,"
Expand Down Expand Up @@ -253,22 +244,6 @@ public Long getDomainId() {
return domainId;
}

private ApiConstants.BootType getBootType() {

if (StringUtils.isNotBlank(bootType)) {
try {
String type = bootType.trim().toUpperCase();
return ApiConstants.BootType.valueOf(type);
} catch (IllegalArgumentException e) {
String errMesg = "Invalid bootType " + bootType + "Specified for vm " + getName()
+ " Valid values are: " + Arrays.toString(ApiConstants.BootType.values());
s_logger.warn(errMesg);
throw new InvalidParameterValueException(errMesg);
}
}
return null;
}

public Map<String, String> getDetails() {
Map<String, String> customparameterMap = new HashMap<String, String>();
if (details != null && details.size() != 0) {
Expand All @@ -281,35 +256,12 @@ public Map<String, String> getDetails() {
}
}
}
if(getBootType() != null){ // export to get
if(getBootType() == ApiConstants.BootType.UEFI) {
customparameterMap.put(getBootType().toString(), getBootMode().toString());
}
}

if (rootdisksize != null && !customparameterMap.containsKey("rootdisksize")) {
customparameterMap.put("rootdisksize", rootdisksize.toString());
}
return customparameterMap;
}


public ApiConstants.BootMode getBootMode() {
if (StringUtils.isNotBlank(bootMode)) {
try {
String mode = bootMode.trim().toUpperCase();
return ApiConstants.BootMode.valueOf(mode);
} catch (IllegalArgumentException e) {
String errMesg = "Invalid bootMode " + bootMode + "Specified for vm " + getName()
+ " Valid values are: "+ Arrays.toString(ApiConstants.BootMode.values());
s_logger.warn(errMesg);
throw new InvalidParameterValueException(errMesg);
}
}
return null;
}


public Map<String, String> getVmOVFProperties() {
Map<String, String> map = new HashMap<>();
if (MapUtils.isNotEmpty(vmOvfProperties)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,6 @@ public class HostResponse extends BaseResponse {
@Param(description = "the admin that annotated this host", since = "4.11")
private String username;

@SerializedName("ueficapability")
@Param(description = "true if the host has capability to support UEFI boot")
private Boolean uefiCapabilty;

@Override
public String getObjectId() {
return this.getId();
Expand Down Expand Up @@ -503,14 +499,6 @@ public void setDetails(Map details) {
detailsCopy.remove("username");
detailsCopy.remove("password");

if(detailsCopy.containsKey(Host.HOST_UEFI_ENABLE)) {
this.setUefiCapabilty(Boolean.parseBoolean((String) detailsCopy.get(Host.HOST_UEFI_ENABLE)));
detailsCopy.remove(Host.HOST_UEFI_ENABLE);
} else {
this.setUefiCapabilty(new Boolean(false)); // in case of existing host which is not scanned for UEFI capability
}


this.details = detailsCopy;
}

Expand Down Expand Up @@ -680,8 +668,4 @@ public String getHypervisorVersion() {
public Boolean getHaHost() {
return haHost;
}

public void setUefiCapabilty(Boolean hostCapability) {
this.uefiCapabilty = hostCapability;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,6 @@ public class UserVmResponse extends BaseResponseWithTagInformation implements Co
@Param(description = "OS type id of the vm", since = "4.4")
private String osTypeId;

@SerializedName(ApiConstants.BOOT_MODE)
@Param(description = "Guest vm Boot Mode")
private String bootMode;

@SerializedName(ApiConstants.BOOT_TYPE)
@Param(description = "Guest vm Boot Type")
private String bootType;

public UserVmResponse() {
securityGroupList = new LinkedHashSet<SecurityGroupResponse>();
nics = new LinkedHashSet<NicResponse>();
Expand Down Expand Up @@ -881,13 +873,4 @@ public void setDynamicallyScalable(Boolean dynamicallyScalable) {
public String getOsTypeId() {
return osTypeId;
}

public String getBootType() { return bootType; }

public void setBootType(String bootType) { this.bootType = bootType; }

public String getBootMode() { return bootMode; }

public void setBootMode(String bootMode) { this.bootMode = bootMode; }

}
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,4 @@ void deploy(String reservationId, String caller, Map<VirtualMachineProfile.Param
* @param netowrk network to disconnect from
*/
void disconnectFrom(NetworkEntity netowrk, short nicId);

/**
* passing additional params of deployment associated with the virtual machine
*/
void setParamsToEntity(Map<VirtualMachineProfile.Param, Object> params);

}
Original file line number Diff line number Diff line change
Expand Up @@ -1064,10 +1064,6 @@ public void orchestrateStart(final String vmUuid, final Map<VirtualMachineProfil
}

final VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vm, template, offering, owner, params);
s_logger.info(" Uefi params " + "UefiFlag: " + params.get(VirtualMachineProfile.Param.UefiFlag)
+ " Boot Type: " + params.get(VirtualMachineProfile.Param.BootType)
+ " Boot Mode: " + params.get(VirtualMachineProfile.Param.BootMode)
);
DeployDestination dest = null;
try {
dest = _dpMgr.planDeployment(vmProfile, plan, avoids, planner);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMReservationDao;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
import org.apache.commons.collections.MapUtils;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

Expand Down Expand Up @@ -149,15 +148,6 @@ public String reserveVirtualMachine(VMEntityVO vmEntityVO, DeploymentPlanner pla
VMInstanceVO vm = _vmDao.findByUuid(vmEntityVO.getUuid());
VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vm);
vmProfile.setServiceOffering(_serviceOfferingDao.findByIdIncludingRemoved(vm.getId(), vm.getServiceOfferingId()));
if (MapUtils.isNotEmpty(vmEntityVO.getDetails()) &&
vmEntityVO.getDetails().containsKey(VirtualMachineProfile.Param.UefiFlag.getName()) &&
"yes".equalsIgnoreCase(vmEntityVO.getDetails().get(VirtualMachineProfile.Param.UefiFlag.getName())))
{
Map<String, String> details = vmEntityVO.getDetails();
vmProfile.getParameters().put(VirtualMachineProfile.Param.BootType, details.get(VirtualMachineProfile.Param.BootType.getName()));
vmProfile.getParameters().put(VirtualMachineProfile.Param.BootMode, details.get(VirtualMachineProfile.Param.BootMode.getName()));
vmProfile.getParameters().put(VirtualMachineProfile.Param.UefiFlag, details.get(VirtualMachineProfile.Param.UefiFlag.getName()));
}
DataCenterDeployment plan = new DataCenterDeployment(vm.getDataCenterId(), vm.getPodIdToDeployIn(), null, null, null, null);
if (planToDeploy != null && planToDeploy.getDataCenterId() != 0) {
plan =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.HashMap;

import javax.inject.Inject;

import org.apache.commons.collections.MapUtils;
import org.springframework.stereotype.Component;
import org.apache.cloudstack.engine.cloud.entity.api.db.VMEntityVO;

Expand Down Expand Up @@ -271,22 +269,4 @@ public void disconnectFrom(NetworkEntity netowrk, short nicId) {

}

@Override
public void setParamsToEntity(Map<VirtualMachineProfile.Param, Object> map) {
if (MapUtils.isNotEmpty(map)) {
if (this.vmEntityVO != null) {
Map<String, String> details = this.vmEntityVO.getDetails();
if (details == null) {
details = new HashMap<String, String>();
}
for (Map.Entry<VirtualMachineProfile.Param, Object> entry : map.entrySet()) {
if (null != entry && null != entry.getValue() && null != entry.getKey()) {
details.put(entry.getKey().getName(), entry.getValue().toString());
}
}
this.vmEntityVO.setDetails(details);
}
}

}
}
2 changes: 0 additions & 2 deletions engine/schema/src/main/java/com/cloud/host/dao/HostDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,5 @@ public interface HostDao extends GenericDao<HostVO, Long>, StateDao<Status, Stat

List<HostVO> listAllHostsUpByZoneAndHypervisor(long zoneId, HypervisorType hypervisorType);

List<HostVO> listByHostCapability(Host.Type type, Long clusterId, Long podId, long dcId, String hostCapabilty);

List<HostVO> listByClusterAndHypervisorType(long clusterId, HypervisorType hypervisorType);
}
34 changes: 0 additions & 34 deletions engine/schema/src/main/java/com/cloud/host/dao/HostDaoImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import com.cloud.gpu.dao.HostGpuGroupsDao;
import com.cloud.gpu.dao.VGPUTypesDao;
import com.cloud.host.Host;
import com.cloud.host.DetailVO;
import com.cloud.host.Host.Type;
import com.cloud.host.HostTagVO;
import com.cloud.host.HostVO;
Expand Down Expand Up @@ -1223,39 +1222,6 @@ public List<HostVO> listAllHostsUpByZoneAndHypervisor(long zoneId, HypervisorTyp
}

@Override
public List<HostVO> listByHostCapability(Type type, Long clusterId, Long podId, long dcId, String hostCapabilty) {
SearchBuilder<DetailVO> hostCapabilitySearch = _detailsDao.createSearchBuilder();
DetailVO tagEntity = hostCapabilitySearch.entity();
hostCapabilitySearch.and("capability", tagEntity.getName(), SearchCriteria.Op.EQ);
hostCapabilitySearch.and("value", tagEntity.getValue(), SearchCriteria.Op.EQ);

SearchBuilder<HostVO> hostSearch = createSearchBuilder();
HostVO entity = hostSearch.entity();
hostSearch.and("type", entity.getType(), SearchCriteria.Op.EQ);
hostSearch.and("pod", entity.getPodId(), SearchCriteria.Op.EQ);
hostSearch.and("dc", entity.getDataCenterId(), SearchCriteria.Op.EQ);
hostSearch.and("cluster", entity.getClusterId(), SearchCriteria.Op.EQ);
hostSearch.and("status", entity.getStatus(), SearchCriteria.Op.EQ);
hostSearch.and("resourceState", entity.getResourceState(), SearchCriteria.Op.EQ);
hostSearch.join("hostCapabilitySearch", hostCapabilitySearch, entity.getId(), tagEntity.getHostId(), JoinBuilder.JoinType.INNER);

SearchCriteria<HostVO> sc = hostSearch.create();
sc.setJoinParameters("hostCapabilitySearch", "value", Boolean.toString(true));
sc.setJoinParameters("hostCapabilitySearch", "capability", hostCapabilty);
sc.setParameters("type", type.toString());
if (podId != null) {
sc.setParameters("pod", podId);
}
if (clusterId != null) {
sc.setParameters("cluster", clusterId);
}
sc.setParameters("dc", dcId);
sc.setParameters("status", Status.Up.toString());
sc.setParameters("resourceState", ResourceState.Enabled.toString());

return listBy(sc);
}

public List<HostVO> listByClusterAndHypervisorType(long clusterId, HypervisorType hypervisorType) {
SearchCriteria<HostVO> sc = ClusterHypervisorSearch.create();
sc.setParameters("clusterId", clusterId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
import com.cloud.gpu.dao.HostGpuGroupsDao;
import com.cloud.host.HostVO;
import com.cloud.host.dao.HostDao;
import com.cloud.host.dao.HostDetailsDao;
import com.cloud.host.dao.HostTagsDao;
import com.cloud.resource.ResourceManager;
import com.cloud.service.ServiceOfferingVO;
Expand Down Expand Up @@ -574,10 +573,6 @@ public DataStoreManager dataStoreManager() {
return Mockito.mock(DataStoreManager.class);
}

@Bean
public HostDetailsDao hostDetailsDao() { return Mockito.mock(HostDetailsDao.class); }


@Bean
public ClusterDetailsDao clusterDetailsDao() {
return Mockito.mock(ClusterDetailsDao.class);
Expand Down
Loading