mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
Merge branch 'cvm' into 2.2.y
Conflicts: api/src/com/cloud/api/BaseCmd.java cloud.spec core/src/com/cloud/storage/template/DownloadManagerImpl.java server/src/com/cloud/agent/manager/AgentManagerImpl.java server/src/com/cloud/configuration/DefaultComponentLibrary.java server/src/com/cloud/deploy/FirstFitPlanner.java server/src/com/cloud/host/dao/HostDao.java server/src/com/cloud/network/security/SecurityGroupListener.java server/src/com/cloud/storage/StorageManagerImpl.java server/src/com/cloud/storage/listener/StoragePoolMonitor.java server/src/com/cloud/vm/UserVmManagerImpl.java server/src/com/cloud/vm/VirtualMachineManagerImpl.java utils/src/com/cloud/utils/SerialVersionUID.java
This commit is contained in:
commit
18f87c2108
28
api/src/com/cloud/agent/api/PrepareOCFS2NodesCommand.java
Executable file
28
api/src/com/cloud/agent/api/PrepareOCFS2NodesCommand.java
Executable file
@ -0,0 +1,28 @@
|
|||||||
|
package com.cloud.agent.api;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.cloud.utils.Ternary;
|
||||||
|
|
||||||
|
public class PrepareOCFS2NodesCommand extends Command {
|
||||||
|
List<Ternary<Integer, String, String>> nodes;
|
||||||
|
String clusterName;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeInSequence() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PrepareOCFS2NodesCommand(String clusterName, List<Ternary<Integer, String, String>> nodes) {
|
||||||
|
this.nodes = nodes;
|
||||||
|
this.clusterName = clusterName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Ternary<Integer, String, String>> getNodes() {
|
||||||
|
return nodes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getClusterName() {
|
||||||
|
return clusterName;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -93,6 +93,7 @@ public abstract class BaseCmd {
|
|||||||
private static final DateFormat _outputFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
|
private static final DateFormat _outputFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
|
||||||
|
|
||||||
private Object _responseObject = null;
|
private Object _responseObject = null;
|
||||||
|
private Map<String, String> fullUrlParams;
|
||||||
|
|
||||||
@Parameter(name="response", type=CommandType.STRING)
|
@Parameter(name="response", type=CommandType.STRING)
|
||||||
private String responseType;
|
private String responseType;
|
||||||
@ -553,7 +554,16 @@ public abstract class BaseCmd {
|
|||||||
(accountType == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) ||
|
(accountType == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) ||
|
||||||
(accountType == Account.ACCOUNT_TYPE_READ_ONLY_ADMIN));
|
(accountType == Account.ACCOUNT_TYPE_READ_ONLY_ADMIN));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isRootAdmin(short accountType) {
|
public static boolean isRootAdmin(short accountType) {
|
||||||
return ((accountType == Account.ACCOUNT_TYPE_ADMIN));
|
return ((accountType == Account.ACCOUNT_TYPE_ADMIN));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setFullUrlParams(Map<String, String> map) {
|
||||||
|
this.fullUrlParams = map;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, String> getFullUrlParams() {
|
||||||
|
return this.fullUrlParams;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,6 +30,7 @@ public class Hypervisor {
|
|||||||
Parralels,
|
Parralels,
|
||||||
BareMetal,
|
BareMetal,
|
||||||
Simulator,
|
Simulator,
|
||||||
|
Ovm,
|
||||||
|
|
||||||
Any; /*If you don't care about the hypervisor type*/
|
Any; /*If you don't care about the hypervisor type*/
|
||||||
|
|
||||||
@ -56,6 +57,8 @@ public class Hypervisor {
|
|||||||
return HypervisorType.BareMetal;
|
return HypervisorType.BareMetal;
|
||||||
} else if (hypervisor.equalsIgnoreCase("Simulator")) {
|
} else if (hypervisor.equalsIgnoreCase("Simulator")) {
|
||||||
return HypervisorType.Simulator;
|
return HypervisorType.Simulator;
|
||||||
|
} else if (hypervisor.equalsIgnoreCase("Ovm")) {
|
||||||
|
return HypervisorType.Ovm;
|
||||||
} else if (hypervisor.equalsIgnoreCase("Any")) {
|
} else if (hypervisor.equalsIgnoreCase("Any")) {
|
||||||
return HypervisorType.Any;
|
return HypervisorType.Any;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
3
api/src/com/cloud/storage/Storage.java
Normal file → Executable file
3
api/src/com/cloud/storage/Storage.java
Normal file → Executable file
@ -96,7 +96,8 @@ public class Storage {
|
|||||||
LVM(false), // XenServer local LVM SR
|
LVM(false), // XenServer local LVM SR
|
||||||
SharedMountPoint(true),
|
SharedMountPoint(true),
|
||||||
VMFS(true), // VMware VMFS storage
|
VMFS(true), // VMware VMFS storage
|
||||||
PreSetup(true); // for XenServer, Storage Pool is set up by customers.
|
PreSetup(true), // for XenServer, Storage Pool is set up by customers.
|
||||||
|
OCFS2(true);
|
||||||
|
|
||||||
|
|
||||||
boolean shared;
|
boolean shared;
|
||||||
|
|||||||
@ -637,6 +637,7 @@ fi
|
|||||||
%{_javadir}/%{name}-core-extras.jar
|
%{_javadir}/%{name}-core-extras.jar
|
||||||
%{_javadir}/%{name}-server-extras.jar
|
%{_javadir}/%{name}-server-extras.jar
|
||||||
%{_javadir}/%{name}-vmware-base.jar
|
%{_javadir}/%{name}-vmware-base.jar
|
||||||
|
%{_javadir}/%{name}-ovm.jar
|
||||||
# maintain the following list in sync with files agent-scripts
|
# maintain the following list in sync with files agent-scripts
|
||||||
%{_libdir}/%{name}/agent/premium-scripts/*
|
%{_libdir}/%{name}/agent/premium-scripts/*
|
||||||
%{_sysconfdir}/%{name}/management/commands-ext.properties
|
%{_sysconfdir}/%{name}/management/commands-ext.properties
|
||||||
|
|||||||
@ -794,6 +794,10 @@ public class DownloadManagerImpl implements DownloadManager {
|
|||||||
processor.configure("VMDK Processor", params);
|
processor.configure("VMDK Processor", params);
|
||||||
processors.add(new ComponentInfo<Adapter>("VMDK Processor", VmdkProcessor.class, processor));
|
processors.add(new ComponentInfo<Adapter>("VMDK Processor", VmdkProcessor.class, processor));
|
||||||
|
|
||||||
|
processor = new RawImageProcessor();
|
||||||
|
processor.configure("Raw Image Processor", params);
|
||||||
|
processors.add(new ComponentInfo<Adapter>("Raw Image Processor", RawImageProcessor.class, processor));
|
||||||
|
|
||||||
_processors = new Adapters<Processor>("processors", processors);
|
_processors = new Adapters<Processor>("processors", processors);
|
||||||
|
|
||||||
_templateDir = (String) params.get("public.templates.root.dir");
|
_templateDir = (String) params.get("public.templates.root.dir");
|
||||||
|
|||||||
70
core/src/com/cloud/storage/template/RawImageProcessor.java
Normal file
70
core/src/com/cloud/storage/template/RawImageProcessor.java
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
package com.cloud.storage.template;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.ejb.Local;
|
||||||
|
import javax.naming.ConfigurationException;
|
||||||
|
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
import com.cloud.exception.InternalErrorException;
|
||||||
|
import com.cloud.storage.StorageLayer;
|
||||||
|
import com.cloud.storage.Storage.ImageFormat;
|
||||||
|
import com.cloud.storage.template.Processor.FormatInfo;
|
||||||
|
|
||||||
|
@Local(value=Processor.class)
|
||||||
|
public class RawImageProcessor implements Processor {
|
||||||
|
private static final Logger s_logger = Logger.getLogger(RawImageProcessor.class);
|
||||||
|
String _name;
|
||||||
|
StorageLayer _storage;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean configure(String name, Map<String, Object> params)
|
||||||
|
throws ConfigurationException {
|
||||||
|
_name = name;
|
||||||
|
_storage = (StorageLayer)params.get(StorageLayer.InstanceConfigKey);
|
||||||
|
if (_storage == null) {
|
||||||
|
throw new ConfigurationException("Unable to get storage implementation");
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return _name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean start() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean stop() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FormatInfo process(String templatePath, ImageFormat format,
|
||||||
|
String templateName) throws InternalErrorException {
|
||||||
|
if (format != null) {
|
||||||
|
s_logger.debug("We currently don't handle conversion from " + format + " to raw image.");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
String imgPath = templatePath + File.separator + templateName + "." + ImageFormat.RAW.getFileExtension();
|
||||||
|
if (!_storage.exists(imgPath)) {
|
||||||
|
s_logger.debug("Unable to find raw image:" + imgPath);
|
||||||
|
}
|
||||||
|
FormatInfo info = new FormatInfo();
|
||||||
|
info.format = ImageFormat.RAW;
|
||||||
|
info.filename = templateName + "." + ImageFormat.RAW.getFileExtension();
|
||||||
|
info.size = _storage.getSize(imgPath);
|
||||||
|
info.virtualSize = info.size;
|
||||||
|
s_logger.debug("Process raw image " + info.filename + " successfully");
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -2087,7 +2087,7 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, Manager {
|
|||||||
// If this command is from a KVM agent, or from an agent that has a
|
// If this command is from a KVM agent, or from an agent that has a
|
||||||
// null hypervisor type, don't do the CIDR check
|
// null hypervisor type, don't do the CIDR check
|
||||||
if (hypervisorType == null || hypervisorType == HypervisorType.KVM || hypervisorType == HypervisorType.VMware || hypervisorType == HypervisorType.BareMetal
|
if (hypervisorType == null || hypervisorType == HypervisorType.KVM || hypervisorType == HypervisorType.VMware || hypervisorType == HypervisorType.BareMetal
|
||||||
|| hypervisorType == HypervisorType.Simulator) {
|
|| hypervisorType == HypervisorType.Simulator || hypervisorType == HypervisorType.Ovm) {
|
||||||
doCidrCheck = false;
|
doCidrCheck = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -346,7 +346,7 @@ public class ApiServer implements HttpRequestHandler {
|
|||||||
if (cmdClassName != null) {
|
if (cmdClassName != null) {
|
||||||
Class<?> cmdClass = Class.forName(cmdClassName);
|
Class<?> cmdClass = Class.forName(cmdClassName);
|
||||||
BaseCmd cmdObj = (BaseCmd) cmdClass.newInstance();
|
BaseCmd cmdObj = (BaseCmd) cmdClass.newInstance();
|
||||||
|
cmdObj.setFullUrlParams(paramMap);
|
||||||
cmdObj.setResponseType(responseType);
|
cmdObj.setResponseType(responseType);
|
||||||
// This is where the command is either serialized, or directly dispatched
|
// This is where the command is either serialized, or directly dispatched
|
||||||
response = queueCommand(cmdObj, paramMap);
|
response = queueCommand(cmdObj, paramMap);
|
||||||
|
|||||||
0
server/src/com/cloud/capacity/StorageCapacityListener.java
Normal file → Executable file
0
server/src/com/cloud/capacity/StorageCapacityListener.java
Normal file → Executable file
1
server/src/com/cloud/cluster/ClusterAsyncExectuionListener.java
Normal file → Executable file
1
server/src/com/cloud/cluster/ClusterAsyncExectuionListener.java
Normal file → Executable file
@ -76,6 +76,5 @@ public class ClusterAsyncExectuionListener implements Listener {
|
|||||||
public int getTimeout() {
|
public int getTimeout() {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -157,7 +157,7 @@ public enum Config {
|
|||||||
SystemVMAutoReserveCapacity("Advanced", ManagementServer.class, Boolean.class, "system.vm.auto.reserve.capacity", "true", "Indicates whether or not to automatically reserver system VM standby capacity.", null),
|
SystemVMAutoReserveCapacity("Advanced", ManagementServer.class, Boolean.class, "system.vm.auto.reserve.capacity", "true", "Indicates whether or not to automatically reserver system VM standby capacity.", null),
|
||||||
CPUOverprovisioningFactor("Advanced", ManagementServer.class, String.class, "cpu.overprovisioning.factor", "1", "Used for CPU overprovisioning calculation; available CPU will be (actualCpuCapacity * cpu.overprovisioning.factor)", null),
|
CPUOverprovisioningFactor("Advanced", ManagementServer.class, String.class, "cpu.overprovisioning.factor", "1", "Used for CPU overprovisioning calculation; available CPU will be (actualCpuCapacity * cpu.overprovisioning.factor)", null),
|
||||||
LinkLocalIpNums("Advanced", ManagementServer.class, Integer.class, "linkLocalIp.nums", "10", "The number of link local ip that needed by domR(in power of 2)", null),
|
LinkLocalIpNums("Advanced", ManagementServer.class, Integer.class, "linkLocalIp.nums", "10", "The number of link local ip that needed by domR(in power of 2)", null),
|
||||||
HypervisorList("Advanced", ManagementServer.class, String.class, "hypervisor.list", HypervisorType.KVM + "," + HypervisorType.XenServer + "," + HypervisorType.VMware + "," + HypervisorType.BareMetal, "The list of hypervisors that this deployment will use.", "hypervisorList"),
|
HypervisorList("Advanced", ManagementServer.class, String.class, "hypervisor.list", HypervisorType.KVM + "," + HypervisorType.XenServer + "," + HypervisorType.VMware + "," + HypervisorType.BareMetal + "," + HypervisorType.Ovm, "The list of hypervisors that this deployment will use.", "hypervisorList"),
|
||||||
ManagementHostIPAdr("Advanced", ManagementServer.class, String.class, "host", "localhost", "The ip address of management server", null),
|
ManagementHostIPAdr("Advanced", ManagementServer.class, String.class, "host", "localhost", "The ip address of management server", null),
|
||||||
ManagementNetwork("Advanced", ManagementServer.class, String.class, "management.network.cidr", null, "The cidr of management server network", null),
|
ManagementNetwork("Advanced", ManagementServer.class, String.class, "management.network.cidr", null, "The cidr of management server network", null),
|
||||||
EventPurgeDelay("Advanced", ManagementServer.class, Integer.class, "event.purge.delay", "15", "Events older than specified number days will be purged. Set this value to 0 to never delete events", null),
|
EventPurgeDelay("Advanced", ManagementServer.class, Integer.class, "event.purge.delay", "15", "Events older than specified number days will be purged. Set this value to 0 to never delete events", null),
|
||||||
|
|||||||
@ -108,6 +108,7 @@ import com.cloud.network.vpn.RemoteAccessVpnManagerImpl;
|
|||||||
import com.cloud.offerings.dao.NetworkOfferingDaoImpl;
|
import com.cloud.offerings.dao.NetworkOfferingDaoImpl;
|
||||||
import com.cloud.resource.ResourceManagerImpl;
|
import com.cloud.resource.ResourceManagerImpl;
|
||||||
import com.cloud.service.dao.ServiceOfferingDaoImpl;
|
import com.cloud.service.dao.ServiceOfferingDaoImpl;
|
||||||
|
import com.cloud.storage.OCFS2ManagerImpl;
|
||||||
import com.cloud.storage.StorageManagerImpl;
|
import com.cloud.storage.StorageManagerImpl;
|
||||||
import com.cloud.storage.dao.DiskOfferingDaoImpl;
|
import com.cloud.storage.dao.DiskOfferingDaoImpl;
|
||||||
import com.cloud.storage.dao.GuestOSCategoryDaoImpl;
|
import com.cloud.storage.dao.GuestOSCategoryDaoImpl;
|
||||||
@ -315,6 +316,7 @@ public class DefaultComponentLibrary extends ComponentLibraryBase implements Com
|
|||||||
addManager("ClusterFenceManager", ClusterFenceManagerImpl.class);
|
addManager("ClusterFenceManager", ClusterFenceManagerImpl.class);
|
||||||
addManager("ResourceManager", ResourceManagerImpl.class);
|
addManager("ResourceManager", ResourceManagerImpl.class);
|
||||||
addManager("FirewallManager", FirewallManagerImpl.class);
|
addManager("FirewallManager", FirewallManagerImpl.class);
|
||||||
|
addManager("OCFS2Manager", OCFS2ManagerImpl.class);
|
||||||
ComponentInfo<? extends Manager> info = addManager("ConsoleProxyManager", ConsoleProxyManagerImpl.class);
|
ComponentInfo<? extends Manager> info = addManager("ConsoleProxyManager", ConsoleProxyManagerImpl.class);
|
||||||
info.addParameter("consoleproxy.sslEnabled", "true");
|
info.addParameter("consoleproxy.sslEnabled", "true");
|
||||||
addManager("ClusteredAgentManager", ClusteredAgentManagerImpl.class);
|
addManager("ClusteredAgentManager", ClusteredAgentManagerImpl.class);
|
||||||
|
|||||||
0
server/src/com/cloud/consoleproxy/ConsoleProxyListener.java
Normal file → Executable file
0
server/src/com/cloud/consoleproxy/ConsoleProxyListener.java
Normal file → Executable file
1
server/src/com/cloud/dc/ClusterDetailsDaoImpl.java
Normal file → Executable file
1
server/src/com/cloud/dc/ClusterDetailsDaoImpl.java
Normal file → Executable file
@ -54,6 +54,7 @@ public class ClusterDetailsDaoImpl extends GenericDaoBase<ClusterDetailsVO, Long
|
|||||||
return findOneIncludingRemovedBy(sc);
|
return findOneIncludingRemovedBy(sc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, String> findDetails(long clusterId) {
|
public Map<String, String> findDetails(long clusterId) {
|
||||||
SearchCriteria<ClusterDetailsVO> sc = ClusterSearch.create();
|
SearchCriteria<ClusterDetailsVO> sc = ClusterSearch.create();
|
||||||
|
|||||||
@ -175,4 +175,6 @@ public interface HostDao extends GenericDao<HostVO, Long> {
|
|||||||
List<HostVO> listAllRoutingAgents();
|
List<HostVO> listAllRoutingAgents();
|
||||||
|
|
||||||
List<HostVO> findAndUpdateApplianceToLoad(long lastPingSecondsAfter, long managementServerId);
|
List<HostVO> findAndUpdateApplianceToLoad(long lastPingSecondsAfter, long managementServerId);
|
||||||
|
|
||||||
|
List<HostVO> listByInAllStatus(Type type, Long clusterId, Long podId, long dcId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -451,6 +451,23 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
|
|||||||
return listBy(sc);
|
return listBy(sc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<HostVO> listByInAllStatus(Host.Type type, Long clusterId, Long podId, long dcId) {
|
||||||
|
SearchCriteria<HostVO> sc = TypePodDcStatusSearch.create();
|
||||||
|
if ( type != null ) {
|
||||||
|
sc.setParameters("type", type.toString());
|
||||||
|
}
|
||||||
|
if (clusterId != null) {
|
||||||
|
sc.setParameters("cluster", clusterId);
|
||||||
|
}
|
||||||
|
if (podId != null ) {
|
||||||
|
sc.setParameters("pod", podId);
|
||||||
|
}
|
||||||
|
sc.setParameters("dc", dcId);
|
||||||
|
|
||||||
|
return listBy(sc);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<HostVO> listBy(Long clusterId, Long podId, long dcId) {
|
public List<HostVO> listBy(Long clusterId, Long podId, long dcId) {
|
||||||
SearchCriteria<HostVO> sc = TypePodDcStatusSearch.create();
|
SearchCriteria<HostVO> sc = TypePodDcStatusSearch.create();
|
||||||
|
|||||||
@ -46,7 +46,7 @@ public class XenServerGuru extends HypervisorGuruBase implements HypervisorGuru
|
|||||||
@Override
|
@Override
|
||||||
public <T extends VirtualMachine> VirtualMachineTO implement(VirtualMachineProfile<T> vm) {
|
public <T extends VirtualMachine> VirtualMachineTO implement(VirtualMachineProfile<T> vm) {
|
||||||
BootloaderType bt = BootloaderType.PyGrub;
|
BootloaderType bt = BootloaderType.PyGrub;
|
||||||
if (vm.getBootLoaderType() != null) {
|
if (vm.getBootLoaderType() == BootloaderType.CD) {
|
||||||
bt = vm.getBootLoaderType();
|
bt = vm.getBootLoaderType();
|
||||||
}
|
}
|
||||||
VirtualMachineTO to = toVirtualMachineTO(vm);
|
VirtualMachineTO to = toVirtualMachineTO(vm);
|
||||||
|
|||||||
0
server/src/com/cloud/hypervisor/kvm/discoverer/KvmServerDiscoverer.java
Normal file → Executable file
0
server/src/com/cloud/hypervisor/kvm/discoverer/KvmServerDiscoverer.java
Normal file → Executable file
@ -596,5 +596,4 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L
|
|||||||
public boolean processTimeout(long agentId, long seq) {
|
public boolean processTimeout(long agentId, long seq) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
0
server/src/com/cloud/network/SshKeysDistriMonitor.java
Normal file → Executable file
0
server/src/com/cloud/network/SshKeysDistriMonitor.java
Normal file → Executable file
0
server/src/com/cloud/network/ovs/OvsListener.java
Normal file → Executable file
0
server/src/com/cloud/network/ovs/OvsListener.java
Normal file → Executable file
1
server/src/com/cloud/network/ovs/OvsTunnelListener.java
Normal file → Executable file
1
server/src/com/cloud/network/ovs/OvsTunnelListener.java
Normal file → Executable file
@ -130,5 +130,4 @@ public class OvsTunnelListener implements Listener {
|
|||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
1
server/src/com/cloud/network/security/SecurityGroupListener.java
Normal file → Executable file
1
server/src/com/cloud/network/security/SecurityGroupListener.java
Normal file → Executable file
@ -150,7 +150,6 @@ public class SecurityGroupListener implements Listener {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean processTimeout(long agentId, long seq) {
|
public boolean processTimeout(long agentId, long seq) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -361,7 +361,7 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma
|
|||||||
allocationState = Host.HostAllocationState.Enabled.toString();
|
allocationState = Host.HostAllocationState.Enabled.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
return discoverHostsFull(dcId, podId, clusterId, clusterName, url, username, password, cmd.getHypervisor(), hostTags, bareMetalParams, allocationState);
|
return discoverHostsFull(dcId, podId, clusterId, clusterName, url, username, password, cmd.getHypervisor(), hostTags, cmd.getFullUrlParams(), allocationState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
0
server/src/com/cloud/storage/LocalStoragePoolListener.java
Normal file → Executable file
0
server/src/com/cloud/storage/LocalStoragePoolListener.java
Normal file → Executable file
15
server/src/com/cloud/storage/OCFS2Manager.java
Executable file
15
server/src/com/cloud/storage/OCFS2Manager.java
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
package com.cloud.storage;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.cloud.host.HostVO;
|
||||||
|
import com.cloud.utils.component.Manager;
|
||||||
|
|
||||||
|
public interface OCFS2Manager extends Manager {
|
||||||
|
static final String CLUSTER_NAME = "clusterName";
|
||||||
|
|
||||||
|
boolean prepareNodes(List<HostVO> hosts, StoragePool pool, Map<String, String> params);
|
||||||
|
|
||||||
|
boolean prepareNodes(Long clusterId);
|
||||||
|
}
|
||||||
140
server/src/com/cloud/storage/OCFS2ManagerImpl.java
Executable file
140
server/src/com/cloud/storage/OCFS2ManagerImpl.java
Executable file
@ -0,0 +1,140 @@
|
|||||||
|
package com.cloud.storage;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.ejb.Local;
|
||||||
|
import javax.naming.ConfigurationException;
|
||||||
|
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
import com.cloud.agent.AgentManager;
|
||||||
|
import com.cloud.agent.api.Answer;
|
||||||
|
import com.cloud.agent.api.PrepareOCFS2NodesCommand;
|
||||||
|
import com.cloud.dc.ClusterDetailsDao;
|
||||||
|
import com.cloud.dc.ClusterVO;
|
||||||
|
import com.cloud.dc.HostPodVO;
|
||||||
|
import com.cloud.dc.dao.ClusterDao;
|
||||||
|
import com.cloud.exception.ResourceUnavailableException;
|
||||||
|
import com.cloud.host.Host;
|
||||||
|
import com.cloud.host.HostVO;
|
||||||
|
import com.cloud.host.dao.HostDao;
|
||||||
|
import com.cloud.storage.Storage.StoragePoolType;
|
||||||
|
import com.cloud.storage.dao.StoragePoolDetailsDao;
|
||||||
|
import com.cloud.utils.Pair;
|
||||||
|
import com.cloud.utils.Ternary;
|
||||||
|
import com.cloud.utils.component.Inject;
|
||||||
|
import com.cloud.utils.exception.CloudRuntimeException;
|
||||||
|
|
||||||
|
@Local(value ={OCFS2Manager.class})
|
||||||
|
public class OCFS2ManagerImpl implements OCFS2Manager {
|
||||||
|
String _name;
|
||||||
|
private static final Logger s_logger = Logger.getLogger(OCFS2ManagerImpl.class);
|
||||||
|
|
||||||
|
@Inject ClusterDetailsDao _clusterDetailsDao;
|
||||||
|
@Inject AgentManager _agentMgr;
|
||||||
|
@Inject HostDao _hostDao;
|
||||||
|
@Inject ClusterDao _clusterDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
||||||
|
_name = name;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean start() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean stop() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return _name;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Ternary<Integer, String, String>> marshalNodes(List<HostVO> hosts) {
|
||||||
|
Integer i = 0;
|
||||||
|
List<Ternary<Integer, String, String>> lst = new ArrayList<Ternary<Integer, String, String>>();
|
||||||
|
for (HostVO h : hosts) {
|
||||||
|
String nodeName = "node_" + h.getPrivateIpAddress().replace(".", "_");
|
||||||
|
Ternary<Integer, String, String> node = new Ternary<Integer, String, String>(i, h.getPrivateIpAddress(), nodeName);
|
||||||
|
lst.add(node);
|
||||||
|
i ++;
|
||||||
|
}
|
||||||
|
return lst;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private boolean prepareNodes(String clusterName, List<HostVO> hosts) {
|
||||||
|
PrepareOCFS2NodesCommand cmd = new PrepareOCFS2NodesCommand(clusterName, marshalNodes(hosts));
|
||||||
|
for (HostVO h : hosts) {
|
||||||
|
Answer ans = _agentMgr.easySend(h.getId(), cmd);
|
||||||
|
if (ans == null) {
|
||||||
|
s_logger.debug("Host " + h.getId() + " is not in UP state, skip preparing OCFS2 node on it");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!ans.getResult()) {
|
||||||
|
s_logger.warn("PrepareOCFS2NodesCommand failed on host " + h.getId() + " " + ans.getDetails());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean prepareNodes(List<HostVO> hosts, StoragePool pool, Map<String, String> params) {
|
||||||
|
if (pool.getPoolType() != StoragePoolType.OCFS2) {
|
||||||
|
throw new CloudRuntimeException("None OCFS2 storage pool is getting into OCFS2 manager!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
String clusterName = params.get(OCFS2Manager.CLUSTER_NAME);
|
||||||
|
if (clusterName == null) {
|
||||||
|
throw new CloudRuntimeException("Cannot get OCFS2 cluster name");
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
String clusterName = "ofcs2";
|
||||||
|
|
||||||
|
Map<String, String> details = _clusterDetailsDao.findDetails(pool.getClusterId());
|
||||||
|
String currentClusterName = details.get(OCFS2Manager.CLUSTER_NAME);
|
||||||
|
if (currentClusterName == null) {
|
||||||
|
details.put(OCFS2Manager.CLUSTER_NAME, clusterName);
|
||||||
|
/* This is actual _clusterDetailsDao.update() */
|
||||||
|
_clusterDetailsDao.persist(pool.getClusterId(), details);
|
||||||
|
} else {
|
||||||
|
if (!currentClusterName.equals(clusterName)) {
|
||||||
|
throw new CloudRuntimeException("Cluster already has name " + currentClusterName + " while name you giving is " + clusterName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return prepareNodes(clusterName, hosts);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean prepareNodes(Long clusterId) {
|
||||||
|
Map<String, String> details = _clusterDetailsDao.findDetails(clusterId);
|
||||||
|
String clusterName = details.get(OCFS2Manager.CLUSTER_NAME);
|
||||||
|
if (clusterName == null) {
|
||||||
|
throw new CloudRuntimeException("Cannot find OCFS2 cluster name for cluster " + clusterId);
|
||||||
|
}
|
||||||
|
|
||||||
|
ClusterVO cluster = _clusterDao.findById(clusterId);
|
||||||
|
if (cluster == null) {
|
||||||
|
throw new CloudRuntimeException("Cannot find cluster for ID " + clusterId);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<HostVO> hosts = _hostDao.listByInAllStatus(Host.Type.Routing, clusterId, cluster.getPodId(), cluster.getDataCenterId());
|
||||||
|
if (hosts.isEmpty()) {
|
||||||
|
throw new CloudRuntimeException("No host up to associate a storage pool with in cluster " + clusterId);
|
||||||
|
}
|
||||||
|
|
||||||
|
return prepareNodes(clusterName, hosts);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -280,9 +280,13 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
|||||||
protected StoragePoolWorkDao _storagePoolWorkDao;
|
protected StoragePoolWorkDao _storagePoolWorkDao;
|
||||||
@Inject
|
@Inject
|
||||||
protected HypervisorGuruManager _hvGuruMgr;
|
protected HypervisorGuruManager _hvGuruMgr;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
protected VolumeDao _volumeDao;
|
protected VolumeDao _volumeDao;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
protected OCFS2Manager _ocfs2Mgr;
|
||||||
|
|
||||||
@Inject(adapter = StoragePoolAllocator.class)
|
@Inject(adapter = StoragePoolAllocator.class)
|
||||||
protected Adapters<StoragePoolAllocator> _storagePoolAllocators;
|
protected Adapters<StoragePoolAllocator> _storagePoolAllocators;
|
||||||
@Inject(adapter = StoragePoolDiscoverer.class)
|
@Inject(adapter = StoragePoolDiscoverer.class)
|
||||||
@ -1188,6 +1192,9 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
|||||||
pool = new StoragePoolVO(StoragePoolType.ISO, storageHost, port, hostPath);
|
pool = new StoragePoolVO(StoragePoolType.ISO, storageHost, port, hostPath);
|
||||||
} else if (scheme.equalsIgnoreCase("vmfs")) {
|
} else if (scheme.equalsIgnoreCase("vmfs")) {
|
||||||
pool = new StoragePoolVO(StoragePoolType.VMFS, "VMFS datastore: " + hostPath, 0, hostPath);
|
pool = new StoragePoolVO(StoragePoolType.VMFS, "VMFS datastore: " + hostPath, 0, hostPath);
|
||||||
|
} else if (scheme.equalsIgnoreCase("ocfs2")) {
|
||||||
|
port = 7777;
|
||||||
|
pool = new StoragePoolVO(StoragePoolType.OCFS2, "clustered", port, hostPath);
|
||||||
} else {
|
} else {
|
||||||
s_logger.warn("Unable to figure out the scheme for URI: " + uri);
|
s_logger.warn("Unable to figure out the scheme for URI: " + uri);
|
||||||
throw new IllegalArgumentException("Unable to figure out the scheme for URI: " + uri);
|
throw new IllegalArgumentException("Unable to figure out the scheme for URI: " + uri);
|
||||||
@ -1235,6 +1242,12 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
|||||||
pool.setStatus(StoragePoolStatus.Up);
|
pool.setStatus(StoragePoolStatus.Up);
|
||||||
pool = _storagePoolDao.persist(pool, details);
|
pool = _storagePoolDao.persist(pool, details);
|
||||||
|
|
||||||
|
if (pool.getPoolType() == StoragePoolType.OCFS2 && !_ocfs2Mgr.prepareNodes(allHosts, pool, cmd.getFullUrlParams())) {
|
||||||
|
s_logger.warn("Can not create storage pool " + pool + " on cluster " + clusterId);
|
||||||
|
_storagePoolDao.expunge(pool.getId());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
for (HostVO h : allHosts) {
|
for (HostVO h : allHosts) {
|
||||||
success = createStoragePool(h.getId(), pool);
|
success = createStoragePool(h.getId(), pool);
|
||||||
@ -1422,7 +1435,7 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
|||||||
s_logger.debug("creating pool " + pool.getName() + " on host " + hostId);
|
s_logger.debug("creating pool " + pool.getName() + " on host " + hostId);
|
||||||
if (pool.getPoolType() != StoragePoolType.NetworkFilesystem && pool.getPoolType() != StoragePoolType.Filesystem && pool.getPoolType() != StoragePoolType.IscsiLUN
|
if (pool.getPoolType() != StoragePoolType.NetworkFilesystem && pool.getPoolType() != StoragePoolType.Filesystem && pool.getPoolType() != StoragePoolType.IscsiLUN
|
||||||
&& pool.getPoolType() != StoragePoolType.Iscsi && pool.getPoolType() != StoragePoolType.VMFS && pool.getPoolType() != StoragePoolType.SharedMountPoint
|
&& pool.getPoolType() != StoragePoolType.Iscsi && pool.getPoolType() != StoragePoolType.VMFS && pool.getPoolType() != StoragePoolType.SharedMountPoint
|
||||||
&& pool.getPoolType() != StoragePoolType.PreSetup) {
|
&& pool.getPoolType() != StoragePoolType.PreSetup && pool.getPoolType() != StoragePoolType.OCFS2) {
|
||||||
s_logger.warn(" Doesn't support storage pool type " + pool.getPoolType());
|
s_logger.warn(" Doesn't support storage pool type " + pool.getPoolType());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
0
server/src/com/cloud/storage/download/DownloadListener.java
Normal file → Executable file
0
server/src/com/cloud/storage/download/DownloadListener.java
Normal file → Executable file
@ -32,18 +32,27 @@ import com.cloud.exception.ConnectionException;
|
|||||||
import com.cloud.host.HostVO;
|
import com.cloud.host.HostVO;
|
||||||
import com.cloud.host.Status;
|
import com.cloud.host.Status;
|
||||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||||
|
import com.cloud.server.ManagementService;
|
||||||
|
import com.cloud.storage.OCFS2Manager;
|
||||||
import com.cloud.storage.StorageManagerImpl;
|
import com.cloud.storage.StorageManagerImpl;
|
||||||
import com.cloud.storage.StoragePoolVO;
|
import com.cloud.storage.StoragePoolVO;
|
||||||
|
import com.cloud.storage.Storage.StoragePoolType;
|
||||||
import com.cloud.storage.dao.StoragePoolDao;
|
import com.cloud.storage.dao.StoragePoolDao;
|
||||||
|
import com.cloud.utils.component.ComponentLocator;
|
||||||
|
import com.cloud.utils.component.Inject;
|
||||||
|
|
||||||
public class StoragePoolMonitor implements Listener {
|
public class StoragePoolMonitor implements Listener {
|
||||||
private static final Logger s_logger = Logger.getLogger(StoragePoolMonitor.class);
|
private static final Logger s_logger = Logger.getLogger(StoragePoolMonitor.class);
|
||||||
private final StorageManagerImpl _storageManager;
|
private final StorageManagerImpl _storageManager;
|
||||||
private final StoragePoolDao _poolDao;
|
private final StoragePoolDao _poolDao;
|
||||||
|
OCFS2Manager _ocfs2Mgr;
|
||||||
|
|
||||||
public StoragePoolMonitor(StorageManagerImpl mgr, StoragePoolDao poolDao) {
|
public StoragePoolMonitor(StorageManagerImpl mgr, StoragePoolDao poolDao) {
|
||||||
this._storageManager = mgr;
|
this._storageManager = mgr;
|
||||||
this._poolDao = poolDao;
|
this._poolDao = poolDao;
|
||||||
|
|
||||||
|
ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
|
||||||
|
this._ocfs2Mgr = locator.getManager(OCFS2Manager.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -67,12 +76,17 @@ public class StoragePoolMonitor implements Listener {
|
|||||||
if (cmd instanceof StartupRoutingCommand) {
|
if (cmd instanceof StartupRoutingCommand) {
|
||||||
StartupRoutingCommand scCmd = (StartupRoutingCommand)cmd;
|
StartupRoutingCommand scCmd = (StartupRoutingCommand)cmd;
|
||||||
if (scCmd.getHypervisorType() == HypervisorType.XenServer || scCmd.getHypervisorType() == HypervisorType.KVM ||
|
if (scCmd.getHypervisorType() == HypervisorType.XenServer || scCmd.getHypervisorType() == HypervisorType.KVM ||
|
||||||
scCmd.getHypervisorType() == HypervisorType.VMware || scCmd.getHypervisorType() == HypervisorType.Simulator) {
|
scCmd.getHypervisorType() == HypervisorType.VMware || scCmd.getHypervisorType() == HypervisorType.Simulator || scCmd.getHypervisorType() == HypervisorType.Ovm) {
|
||||||
List<StoragePoolVO> pools = _poolDao.listBy(host.getDataCenterId(), host.getPodId(), host.getClusterId());
|
List<StoragePoolVO> pools = _poolDao.listBy(host.getDataCenterId(), host.getPodId(), host.getClusterId());
|
||||||
for (StoragePoolVO pool : pools) {
|
for (StoragePoolVO pool : pools) {
|
||||||
if (!pool.getPoolType().isShared()) {
|
if (!pool.getPoolType().isShared()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pool.getPoolType() == StoragePoolType.OCFS2 && !_ocfs2Mgr.prepareNodes(pool.getClusterId())) {
|
||||||
|
throw new ConnectionException(true, "Unable to prepare OCFS2 nodes for pool " + pool.getId());
|
||||||
|
}
|
||||||
|
|
||||||
Long hostId = host.getId();
|
Long hostId = host.getId();
|
||||||
s_logger.debug("Host " + hostId + " connected, sending down storage pool information ...");
|
s_logger.debug("Host " + hostId + " connected, sending down storage pool information ...");
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -80,5 +80,4 @@ public class StorageSyncListener implements Listener {
|
|||||||
public int getTimeout() {
|
public int getTimeout() {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
0
server/src/com/cloud/storage/secondary/SecondaryStorageListener.java
Normal file → Executable file
0
server/src/com/cloud/storage/secondary/SecondaryStorageListener.java
Normal file → Executable file
@ -446,5 +446,4 @@ public class UploadListener implements Listener {
|
|||||||
public void setCurrState(Status uploadState) {
|
public void setCurrState(Status uploadState) {
|
||||||
this.currState = getState(currState.toString());
|
this.currState = getState(currState.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -95,7 +95,8 @@ public class HyervisorTemplateAdapter extends TemplateAdapterBase implements Tem
|
|||||||
&&(!url.toLowerCase().endsWith("qcow2"))&&(!url.toLowerCase().endsWith("qcow2.zip"))
|
&&(!url.toLowerCase().endsWith("qcow2"))&&(!url.toLowerCase().endsWith("qcow2.zip"))
|
||||||
&&(!url.toLowerCase().endsWith("qcow2.bz2"))&&(!url.toLowerCase().endsWith("qcow2.gz"))
|
&&(!url.toLowerCase().endsWith("qcow2.bz2"))&&(!url.toLowerCase().endsWith("qcow2.gz"))
|
||||||
&&(!url.toLowerCase().endsWith("ova"))&&(!url.toLowerCase().endsWith("ova.zip"))
|
&&(!url.toLowerCase().endsWith("ova"))&&(!url.toLowerCase().endsWith("ova.zip"))
|
||||||
&&(!url.toLowerCase().endsWith("ova.bz2"))&&(!url.toLowerCase().endsWith("ova.gz"))){
|
&&(!url.toLowerCase().endsWith("ova.bz2"))&&(!url.toLowerCase().endsWith("ova.gz"))
|
||||||
|
&&(!url.toLowerCase().endsWith("img"))&&(!url.toLowerCase().endsWith("raw"))){
|
||||||
throw new InvalidParameterValueException("Please specify a valid "+ cmd.getFormat().toLowerCase());
|
throw new InvalidParameterValueException("Please specify a valid "+ cmd.getFormat().toLowerCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2673,19 +2673,23 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||||||
throw new PermissionDeniedException("The owner of " + vm + " is disabled: " + vm.getAccountId());
|
throw new PermissionDeniedException("The owner of " + vm + " is disabled: " + vm.getAccountId());
|
||||||
}
|
}
|
||||||
|
|
||||||
VirtualMachineTemplate template = profile.getTemplate();
|
|
||||||
if (vm.getIsoId() != null) {
|
if (vm.getIsoId() != null) {
|
||||||
template = _templateDao.findById(vm.getIsoId());
|
|
||||||
}
|
|
||||||
if (template != null && template.getFormat() == ImageFormat.ISO && vm.getIsoId() != null) {
|
|
||||||
String isoPath = null;
|
String isoPath = null;
|
||||||
|
|
||||||
|
VirtualMachineTemplate template = _templateDao.findById(vm.getIsoId());
|
||||||
|
if (template == null || template.getFormat() != ImageFormat.ISO) {
|
||||||
|
throw new CloudRuntimeException("Can not find ISO in vm_template table for id " + vm.getIsoId());
|
||||||
|
}
|
||||||
|
|
||||||
Pair<String, String> isoPathPair = _storageMgr.getAbsoluteIsoPath(template.getId(), vm.getDataCenterIdToDeployIn());
|
Pair<String, String> isoPathPair = _storageMgr.getAbsoluteIsoPath(template.getId(), vm.getDataCenterIdToDeployIn());
|
||||||
|
|
||||||
if (isoPathPair == null) {
|
if (isoPathPair == null) {
|
||||||
s_logger.warn("Couldn't get absolute iso path");
|
s_logger.warn("Couldn't get absolute iso path");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
isoPath = isoPathPair.first();
|
isoPath = isoPathPair.first();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (template.isBootable()) {
|
if (template.isBootable()) {
|
||||||
profile.setBootLoaderType(BootloaderType.CD);
|
profile.setBootLoaderType(BootloaderType.CD);
|
||||||
}
|
}
|
||||||
@ -2699,6 +2703,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||||||
iso.setDeviceId(3);
|
iso.setDeviceId(3);
|
||||||
profile.addDisk(iso);
|
profile.addDisk(iso);
|
||||||
} else {
|
} else {
|
||||||
|
VirtualMachineTemplate template = profile.getTemplate();
|
||||||
/* create a iso placeholder */
|
/* create a iso placeholder */
|
||||||
VolumeTO iso = new VolumeTO(profile.getId(), Volume.Type.ISO, StoragePoolType.ISO, null, template.getName(), null, null, 0, null);
|
VolumeTO iso = new VolumeTO(profile.getId(), Volume.Type.ISO, StoragePoolType.ISO, null, template.getName(), null, null, 0, null);
|
||||||
iso.setDeviceId(3);
|
iso.setDeviceId(3);
|
||||||
|
|||||||
@ -279,6 +279,20 @@ dictionary = {
|
|||||||
<input class="text" type="text" name="host_baremetal_mac" id="host_baremetal_mac" />
|
<input class="text" type="text" name="host_baremetal_mac" id="host_baremetal_mac" />
|
||||||
<div id="host_baremetal_mac_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
<div id="host_baremetal_mac_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
||||||
</div>
|
</div>
|
||||||
|
</li>
|
||||||
|
<li input_group="Ovm" style="display: none;">
|
||||||
|
<label>
|
||||||
|
Agent Username:</label>
|
||||||
|
<input class="text" type="text" id="agent_username" value="oracle" />
|
||||||
|
<div id="agent_username_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li input_group="Ovm" style="display: none;">
|
||||||
|
<label>
|
||||||
|
Agent Password:</label>
|
||||||
|
<input class="text" type="password" id="agent_password" />
|
||||||
|
<div id="agent_password_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label input_group="general">
|
<label input_group="general">
|
||||||
|
|||||||
@ -818,6 +818,20 @@ dictionary = {
|
|||||||
<input class="text" type="text" name="host_baremetal_mac" id="host_baremetal_mac" />
|
<input class="text" type="text" name="host_baremetal_mac" id="host_baremetal_mac" />
|
||||||
<div id="host_baremetal_mac_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
<div id="host_baremetal_mac_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
||||||
</div>
|
</div>
|
||||||
|
</li>
|
||||||
|
<li input_group="Ovm" style="display: none;">
|
||||||
|
<label>
|
||||||
|
Agent Username:</label>
|
||||||
|
<input class="text" type="text" id="agent_username" value="oracle" />
|
||||||
|
<div id="agent_username_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li input_group="Ovm" style="display: none;">
|
||||||
|
<label>
|
||||||
|
Agent Password:</label>
|
||||||
|
<input class="text" type="password" id="agent_password" />
|
||||||
|
<div id="agent_password_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label input_group="general">
|
<label input_group="general">
|
||||||
|
|||||||
@ -505,6 +505,20 @@ dictionary = {
|
|||||||
<input class="text" type="text" name="host_baremetal_mac" id="host_baremetal_mac" />
|
<input class="text" type="text" name="host_baremetal_mac" id="host_baremetal_mac" />
|
||||||
<div id="host_baremetal_mac_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
<div id="host_baremetal_mac_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
||||||
</div>
|
</div>
|
||||||
|
</li>
|
||||||
|
<li input_group="Ovm" style="display: none;">
|
||||||
|
<label>
|
||||||
|
Agent Username:</label>
|
||||||
|
<input class="text" type="text" id="agent_username" value="oracle" />
|
||||||
|
<div id="agent_username_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li input_group="Ovm" style="display: none;">
|
||||||
|
<label>
|
||||||
|
Agent Password:</label>
|
||||||
|
<input class="text" type="password" id="agent_password" />
|
||||||
|
<div id="agent_password_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label input_group="general">
|
<label input_group="general">
|
||||||
|
|||||||
@ -983,6 +983,20 @@
|
|||||||
<input class="text" type="text" name="host_baremetal_mac" id="host_baremetal_mac" />
|
<input class="text" type="text" name="host_baremetal_mac" id="host_baremetal_mac" />
|
||||||
<div id="host_baremetal_mac_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
<div id="host_baremetal_mac_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
||||||
</div>
|
</div>
|
||||||
|
</li>
|
||||||
|
<li input_group="Ovm" style="display: none;">
|
||||||
|
<label>
|
||||||
|
Agent Username:</label>
|
||||||
|
<input class="text" type="text" id="agent_username" value="oracle" />
|
||||||
|
<div id="agent_username_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li input_group="Ovm" style="display: none;">
|
||||||
|
<label>
|
||||||
|
Agent Password:</label>
|
||||||
|
<input class="text" type="password" id="agent_password" />
|
||||||
|
<div id="agent_password_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label input_group="general">
|
<label input_group="general">
|
||||||
|
|||||||
@ -471,6 +471,20 @@ dictionary = {
|
|||||||
<input class="text" type="text" name="host_baremetal_mac" id="host_baremetal_mac" />
|
<input class="text" type="text" name="host_baremetal_mac" id="host_baremetal_mac" />
|
||||||
<div id="host_baremetal_mac_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
<div id="host_baremetal_mac_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
||||||
</div>
|
</div>
|
||||||
|
</li>
|
||||||
|
<li input_group="Ovm" style="display: none;">
|
||||||
|
<label>
|
||||||
|
Agent Username:</label>
|
||||||
|
<input class="text" type="text" id="agent_username" value="oracle" />
|
||||||
|
<div id="agent_username_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li input_group="Ovm" style="display: none;">
|
||||||
|
<label>
|
||||||
|
Agent Password:</label>
|
||||||
|
<input class="text" type="password" id="agent_password" />
|
||||||
|
<div id="agent_password_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label input_group="general">
|
<label input_group="general">
|
||||||
|
|||||||
@ -539,61 +539,72 @@ function bindAddClusterButton($leftmenuItem1) {
|
|||||||
function bindAddHostButton($leftmenuItem1) {
|
function bindAddHostButton($leftmenuItem1) {
|
||||||
var $button = $("#add_host_button");
|
var $button = $("#add_host_button");
|
||||||
|
|
||||||
var dialogAddHost = $("#dialog_add_host");
|
var $dialogAddHost = $("#dialog_add_host");
|
||||||
dialogAddHost.find("#cluster_select").change(function() {
|
$dialogAddHost.find("#cluster_select").change(function() {
|
||||||
var clusterId = $(this).val();
|
var clusterId = $(this).val();
|
||||||
if(clusterId == null)
|
if(clusterId == null)
|
||||||
return;
|
return;
|
||||||
var clusterObj = clustersUnderOnePod[clusterId];
|
var clusterObj = clustersUnderOnePod[clusterId];
|
||||||
if(clusterObj.hypervisortype == "VMware") {
|
if(clusterObj.hypervisortype == "VMware") {
|
||||||
$('li[input_group="vmware"]', dialogAddHost).show();
|
$('li[input_group="vmware"]', $dialogAddHost).show();
|
||||||
$('li[input_group="general"]', dialogAddHost).hide();
|
$('li[input_group="general"]', $dialogAddHost).hide();
|
||||||
$('li[input_group="baremetal"]', dialogAddHost).hide();
|
$('li[input_group="baremetal"]', $dialogAddHost).hide();
|
||||||
} else if (clusterObj.hypervisortype == "BareMetal") {
|
$('li[input_group="Ovm"]', $dialogAddHost).hide();
|
||||||
$('li[input_group="vmware"]', dialogAddHost).hide();
|
}
|
||||||
$('li[input_group="general"]', dialogAddHost).show();
|
else if (clusterObj.hypervisortype == "BareMetal") {
|
||||||
$('li[input_group="baremetal"]', dialogAddHost).show();
|
$('li[input_group="baremetal"]', $dialogAddHost).show();
|
||||||
} else {
|
$('li[input_group="general"]', $dialogAddHost).show();
|
||||||
$('li[input_group="vmware"]', dialogAddHost).hide();
|
$('li[input_group="vmware"]', $dialogAddHost).hide();
|
||||||
$('li[input_group="general"]', dialogAddHost).show();
|
$('li[input_group="Ovm"]', $dialogAddHost).hide();
|
||||||
$('li[input_group="baremetal"]', dialogAddHost).hide();
|
}
|
||||||
|
else if (clusterObj.hypervisortype == "Ovm") {
|
||||||
|
$('li[input_group="Ovm"]', $dialogAddHost).show();
|
||||||
|
$('li[input_group="general"]', $dialogAddHost).show();
|
||||||
|
$('li[input_group="vmware"]', $dialogAddHost).hide();
|
||||||
|
$('li[input_group="baremetal"]', $dialogAddHost).hide();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('li[input_group="general"]', $dialogAddHost).show();
|
||||||
|
$('li[input_group="vmware"]', $dialogAddHost).hide();
|
||||||
|
$('li[input_group="baremetal"]', $dialogAddHost).hide();
|
||||||
|
$('li[input_group="Ovm"]', $dialogAddHost).hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$button.unbind("click").bind("click", function(event) {
|
$button.unbind("click").bind("click", function(event) {
|
||||||
dialogAddHost.find("#info_container").hide();
|
$dialogAddHost.find("#info_container").hide();
|
||||||
dialogAddHost.find("#new_cluster_name").val("");
|
$dialogAddHost.find("#new_cluster_name").val("");
|
||||||
|
|
||||||
var zoneId, podId, clusterId;
|
var zoneId, podId, clusterId;
|
||||||
if(currentRightPanelJSP == "jsp/pod.jsp") {
|
if(currentRightPanelJSP == "jsp/pod.jsp") {
|
||||||
var podObj = $leftmenuItem1.data("jsonObj");
|
var podObj = $leftmenuItem1.data("jsonObj");
|
||||||
zoneId = podObj.zoneid;
|
zoneId = podObj.zoneid;
|
||||||
podId = podObj.id;
|
podId = podObj.id;
|
||||||
dialogAddHost.find("#zone_name").text(fromdb(podObj.zonename));
|
$dialogAddHost.find("#zone_name").text(fromdb(podObj.zonename));
|
||||||
dialogAddHost.find("#pod_name").text(fromdb(podObj.name));
|
$dialogAddHost.find("#pod_name").text(fromdb(podObj.name));
|
||||||
}
|
}
|
||||||
else if(currentRightPanelJSP == "jsp/cluster.jsp") {
|
else if(currentRightPanelJSP == "jsp/cluster.jsp") {
|
||||||
var clusterObj = $leftmenuItem1.data("jsonObj");
|
var clusterObj = $leftmenuItem1.data("jsonObj");
|
||||||
zoneId = clusterObj.zoneid;
|
zoneId = clusterObj.zoneid;
|
||||||
podId = clusterObj.podid;
|
podId = clusterObj.podid;
|
||||||
clusterId = clusterObj.id;
|
clusterId = clusterObj.id;
|
||||||
dialogAddHost.find("#zone_name").text(fromdb(clusterObj.zonename));
|
$dialogAddHost.find("#zone_name").text(fromdb(clusterObj.zonename));
|
||||||
dialogAddHost.find("#pod_name").text(fromdb(clusterObj.podname));
|
$dialogAddHost.find("#pod_name").text(fromdb(clusterObj.podname));
|
||||||
}
|
}
|
||||||
else if(currentRightPanelJSP == "jsp/host.jsp") {
|
else if(currentRightPanelJSP == "jsp/host.jsp") {
|
||||||
var clusterObj = $leftmenuItem1.data("clusterObj");
|
var clusterObj = $leftmenuItem1.data("clusterObj");
|
||||||
zoneId = clusterObj.zoneid;
|
zoneId = clusterObj.zoneid;
|
||||||
podId = clusterObj.podid;
|
podId = clusterObj.podid;
|
||||||
clusterId = clusterObj.id;
|
clusterId = clusterObj.id;
|
||||||
dialogAddHost.find("#zone_name").text(fromdb(clusterObj.zonename));
|
$dialogAddHost.find("#zone_name").text(fromdb(clusterObj.zonename));
|
||||||
dialogAddHost.find("#pod_name").text(fromdb(clusterObj.podname));
|
$dialogAddHost.find("#pod_name").text(fromdb(clusterObj.podname));
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshClsuterFieldInAddHostDialog(dialogAddHost, podId, clusterId);
|
refreshClsuterFieldInAddHostDialog($dialogAddHost, podId, clusterId);
|
||||||
|
|
||||||
dialogAddHost.find("#cluster_select").change();
|
$dialogAddHost.find("#cluster_select").change();
|
||||||
|
|
||||||
dialogAddHost
|
$dialogAddHost
|
||||||
.dialog('option', 'buttons', {
|
.dialog('option', 'buttons', {
|
||||||
"Add": function() {
|
"Add": function() {
|
||||||
var $thisDialog = $(this);
|
var $thisDialog = $(this);
|
||||||
@ -617,16 +628,23 @@ function bindAddHostButton($leftmenuItem1) {
|
|||||||
isValid &= validateString("vCenter Datacenter", $thisDialog.find("#host_vcenter_dc"), $thisDialog.find("#host_vcenter_dc_errormsg"));
|
isValid &= validateString("vCenter Datacenter", $thisDialog.find("#host_vcenter_dc"), $thisDialog.find("#host_vcenter_dc_errormsg"));
|
||||||
*/
|
*/
|
||||||
isValid &= validateString("vCenter Host", $thisDialog.find("#host_vcenter_host"), $thisDialog.find("#host_vcenter_host_errormsg"));
|
isValid &= validateString("vCenter Host", $thisDialog.find("#host_vcenter_host"), $thisDialog.find("#host_vcenter_host_errormsg"));
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
|
//general
|
||||||
|
isValid &= validateString("Host name", $thisDialog.find("#host_hostname"), $thisDialog.find("#host_hostname_errormsg"));
|
||||||
|
isValid &= validateString("User name", $thisDialog.find("#host_username"), $thisDialog.find("#host_username_errormsg"));
|
||||||
|
isValid &= validateString("Password", $thisDialog.find("#host_password"), $thisDialog.find("#host_password_errormsg"));
|
||||||
|
|
||||||
if (hypervisor == "BareMetal") {
|
if (hypervisor == "BareMetal") {
|
||||||
isValid &= validateString("CPU Cores", $thisDialog.find("#host_baremetal_cpucores"), $thisDialog.find("#host_baremetal_cpucores_errormsg"));
|
isValid &= validateString("CPU Cores", $thisDialog.find("#host_baremetal_cpucores"), $thisDialog.find("#host_baremetal_cpucores_errormsg"));
|
||||||
isValid &= validateString("CPU", $thisDialog.find("#host_baremetal_cpu"), $thisDialog.find("#host_baremetal_cpu_errormsg"));
|
isValid &= validateString("CPU", $thisDialog.find("#host_baremetal_cpu"), $thisDialog.find("#host_baremetal_cpu_errormsg"));
|
||||||
isValid &= validateString("Memory", $thisDialog.find("#host_baremetal_memory"), $thisDialog.find("#host_baremetal_memory_errormsg"));
|
isValid &= validateString("Memory", $thisDialog.find("#host_baremetal_memory"), $thisDialog.find("#host_baremetal_memory_errormsg"));
|
||||||
isValid &= validateString("MAC", $thisDialog.find("#host_baremetal_mac"), $thisDialog.find("#host_baremetal_mac_errormsg"));
|
isValid &= validateString("MAC", $thisDialog.find("#host_baremetal_mac"), $thisDialog.find("#host_baremetal_mac_errormsg"));
|
||||||
}
|
}
|
||||||
isValid &= validateString("Host name", $thisDialog.find("#host_hostname"), $thisDialog.find("#host_hostname_errormsg"));
|
else if(hypervisor == "Ovm") {
|
||||||
isValid &= validateString("User name", $thisDialog.find("#host_username"), $thisDialog.find("#host_username_errormsg"));
|
isValid &= validateString("Agent Username", $thisDialog.find("#agent_username"), $thisDialog.find("#agent_username_errormsg"), true); //optional
|
||||||
isValid &= validateString("Password", $thisDialog.find("#host_password"), $thisDialog.find("#host_password_errormsg"));
|
isValid &= validateString("Agent Password", $thisDialog.find("#agent_password"), $thisDialog.find("#agent_password_errormsg"), false); //required
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!isValid)
|
if (!isValid)
|
||||||
@ -665,20 +683,8 @@ function bindAddHostButton($leftmenuItem1) {
|
|||||||
else
|
else
|
||||||
url = hostname;
|
url = hostname;
|
||||||
array1.push("&url="+todb(url));
|
array1.push("&url="+todb(url));
|
||||||
} else {
|
|
||||||
if (hypervisor == "BareMetal") {
|
|
||||||
var cpuCores = trim($thisDialog.find("#host_baremetal_cpucores").val());
|
|
||||||
array1.push("&cpunumber="+todb(cpuCores));
|
|
||||||
|
|
||||||
var cpuSpeed = trim($thisDialog.find("#host_baremetal_cpu").val());
|
|
||||||
array1.push("&cpuspeed="+todb(cpuSpeed));
|
|
||||||
|
|
||||||
var memory = trim($thisDialog.find("#host_baremetal_memory").val());
|
|
||||||
array1.push("&memory="+todb(memory));
|
|
||||||
|
|
||||||
var mac = trim($thisDialog.find("#host_baremetal_mac").val());
|
|
||||||
array1.push("&hostmac="+todb(mac));
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
var username = trim($thisDialog.find("#host_username").val());
|
var username = trim($thisDialog.find("#host_username").val());
|
||||||
array1.push("&username="+todb(username));
|
array1.push("&username="+todb(username));
|
||||||
|
|
||||||
@ -692,6 +698,27 @@ function bindAddHostButton($leftmenuItem1) {
|
|||||||
else
|
else
|
||||||
url = hostname;
|
url = hostname;
|
||||||
array1.push("&url="+todb(url));
|
array1.push("&url="+todb(url));
|
||||||
|
|
||||||
|
if (hypervisor == "BareMetal") {
|
||||||
|
var cpuCores = trim($thisDialog.find("#host_baremetal_cpucores").val());
|
||||||
|
array1.push("&cpunumber="+todb(cpuCores));
|
||||||
|
|
||||||
|
var cpuSpeed = trim($thisDialog.find("#host_baremetal_cpu").val());
|
||||||
|
array1.push("&cpuspeed="+todb(cpuSpeed));
|
||||||
|
|
||||||
|
var memory = trim($thisDialog.find("#host_baremetal_memory").val());
|
||||||
|
array1.push("&memory="+todb(memory));
|
||||||
|
|
||||||
|
var mac = trim($thisDialog.find("#host_baremetal_mac").val());
|
||||||
|
array1.push("&hostmac="+todb(mac));
|
||||||
|
}
|
||||||
|
else if(hypervisor == "Ovm") {
|
||||||
|
var agentUsername = $thisDialog.find("#agent_username").val();
|
||||||
|
array1.push("&agentusername="+todb(agentUsername));
|
||||||
|
|
||||||
|
var agentPassword = $thisDialog.find("#agent_password").val();
|
||||||
|
array1.push("&agentpassword="+todb(agentPassword));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -717,7 +744,7 @@ function bindAddHostButton($leftmenuItem1) {
|
|||||||
},
|
},
|
||||||
error: function(XMLHttpResponse) {
|
error: function(XMLHttpResponse) {
|
||||||
handleError(XMLHttpResponse, function() {
|
handleError(XMLHttpResponse, function() {
|
||||||
//refreshClsuterFieldInAddHostDialog($thisDialog, podId, clusterId, dialogAddHost.find("#host_hypervisor").val());
|
//refreshClsuterFieldInAddHostDialog($thisDialog, podId, clusterId, $dialogAddHost.find("#host_hypervisor").val());
|
||||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -845,19 +845,31 @@ function initAddHostShortcut() {
|
|||||||
if(clusterId == null)
|
if(clusterId == null)
|
||||||
return;
|
return;
|
||||||
var clusterObj = clustersUnderOnePod[clusterId];
|
var clusterObj = clustersUnderOnePod[clusterId];
|
||||||
|
|
||||||
if(clusterObj.hypervisortype == "VMware") {
|
if(clusterObj.hypervisortype == "VMware") {
|
||||||
$('li[input_group="vmware"]', $dialogAddHost).show();
|
$('li[input_group="vmware"]', $dialogAddHost).show();
|
||||||
$('li[input_group="general"]', $dialogAddHost).hide();
|
$('li[input_group="general"]', $dialogAddHost).hide();
|
||||||
$('li[input_group="baremetal"]', $dialogAddHost).hide();
|
$('li[input_group="baremetal"]', $dialogAddHost).hide();
|
||||||
} else if (clusterObj.hypervisortype == "BareMetal") {
|
$('li[input_group="Ovm"]', $dialogAddHost).hide();
|
||||||
$('li[input_group="vmware"]', $dialogAddHost).hide();
|
}
|
||||||
$('li[input_group="general"]', $dialogAddHost).show();
|
else if (clusterObj.hypervisortype == "BareMetal") {
|
||||||
$('li[input_group="baremetal"]', $dialogAddHost).show();
|
$('li[input_group="baremetal"]', $dialogAddHost).show();
|
||||||
} else {
|
|
||||||
$('li[input_group="vmware"]', $dialogAddHost).hide();
|
|
||||||
$('li[input_group="general"]', $dialogAddHost).show();
|
$('li[input_group="general"]', $dialogAddHost).show();
|
||||||
|
$('li[input_group="vmware"]', $dialogAddHost).hide();
|
||||||
|
$('li[input_group="Ovm"]', $dialogAddHost).hide();
|
||||||
|
}
|
||||||
|
else if (clusterObj.hypervisortype == "Ovm") {
|
||||||
|
$('li[input_group="Ovm"]', $dialogAddHost).show();
|
||||||
|
$('li[input_group="general"]', $dialogAddHost).show();
|
||||||
|
$('li[input_group="vmware"]', $dialogAddHost).hide();
|
||||||
$('li[input_group="baremetal"]', $dialogAddHost).hide();
|
$('li[input_group="baremetal"]', $dialogAddHost).hide();
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$('li[input_group="general"]', $dialogAddHost).show();
|
||||||
|
$('li[input_group="vmware"]', $dialogAddHost).hide();
|
||||||
|
$('li[input_group="baremetal"]', $dialogAddHost).hide();
|
||||||
|
$('li[input_group="Ovm"]', $dialogAddHost).hide();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#add_host_shortcut").unbind("click").bind("click", function(event) {
|
$("#add_host_shortcut").unbind("click").bind("click", function(event) {
|
||||||
@ -889,16 +901,22 @@ function initAddHostShortcut() {
|
|||||||
isValid &= validateString("vCenter Datacenter", $thisDialog.find("#host_vcenter_dc"), $thisDialog.find("#host_vcenter_dc_errormsg"));
|
isValid &= validateString("vCenter Datacenter", $thisDialog.find("#host_vcenter_dc"), $thisDialog.find("#host_vcenter_dc_errormsg"));
|
||||||
*/
|
*/
|
||||||
isValid &= validateString("vCenter Host", $thisDialog.find("#host_vcenter_host"), $thisDialog.find("#host_vcenter_host_errormsg"));
|
isValid &= validateString("vCenter Host", $thisDialog.find("#host_vcenter_host"), $thisDialog.find("#host_vcenter_host_errormsg"));
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
|
isValid &= validateString("Host name", $thisDialog.find("#host_hostname"), $thisDialog.find("#host_hostname_errormsg"));
|
||||||
|
isValid &= validateString("User name", $thisDialog.find("#host_username"), $thisDialog.find("#host_username_errormsg"));
|
||||||
|
isValid &= validateString("Password", $thisDialog.find("#host_password"), $thisDialog.find("#host_password_errormsg"));
|
||||||
|
|
||||||
if (hypervisor == "BareMetal") {
|
if (hypervisor == "BareMetal") {
|
||||||
isValid &= validateString("CPU Cores", $thisDialog.find("#host_baremetal_cpucores"), $thisDialog.find("#host_baremetal_cpucores_errormsg"));
|
isValid &= validateString("CPU Cores", $thisDialog.find("#host_baremetal_cpucores"), $thisDialog.find("#host_baremetal_cpucores_errormsg"));
|
||||||
isValid &= validateString("CPU", $thisDialog.find("#host_baremetal_cpu"), $thisDialog.find("#host_baremetal_cpu_errormsg"));
|
isValid &= validateString("CPU", $thisDialog.find("#host_baremetal_cpu"), $thisDialog.find("#host_baremetal_cpu_errormsg"));
|
||||||
isValid &= validateString("Memory", $thisDialog.find("#host_baremetal_memory"), $thisDialog.find("#host_baremetal_memory_errormsg"));
|
isValid &= validateString("Memory", $thisDialog.find("#host_baremetal_memory"), $thisDialog.find("#host_baremetal_memory_errormsg"));
|
||||||
isValid &= validateString("MAC", $thisDialog.find("#host_baremetal_mac"), $thisDialog.find("#host_baremetal_mac_errormsg"));
|
isValid &= validateString("MAC", $thisDialog.find("#host_baremetal_mac"), $thisDialog.find("#host_baremetal_mac_errormsg"));
|
||||||
}
|
}
|
||||||
isValid &= validateString("Host name", $thisDialog.find("#host_hostname"), $thisDialog.find("#host_hostname_errormsg"));
|
else if(hypervisor == "Ovm") {
|
||||||
isValid &= validateString("User name", $thisDialog.find("#host_username"), $thisDialog.find("#host_username_errormsg"));
|
isValid &= validateString("Agent Username", $thisDialog.find("#agent_username"), $thisDialog.find("#agent_username_errormsg"), true); //optional
|
||||||
isValid &= validateString("Password", $thisDialog.find("#host_password"), $thisDialog.find("#host_password_errormsg"));
|
isValid &= validateString("Agent Password", $thisDialog.find("#agent_password"), $thisDialog.find("#agent_password_errormsg"), false); //required
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!isValid)
|
if (!isValid)
|
||||||
@ -950,20 +968,8 @@ function initAddHostShortcut() {
|
|||||||
url = hostname;
|
url = hostname;
|
||||||
array1.push("&url="+todb(url));
|
array1.push("&url="+todb(url));
|
||||||
|
|
||||||
} else {
|
|
||||||
if (hypervisor == "BareMetal") {
|
|
||||||
var cpuCores = trim($thisDialog.find("#host_baremetal_cpucores").val());
|
|
||||||
array1.push("&cpunumber="+todb(cpuCores));
|
|
||||||
|
|
||||||
var cpuSpeed = trim($thisDialog.find("#host_baremetal_cpu").val());
|
|
||||||
array1.push("&cpuspeed="+todb(cpuSpeed));
|
|
||||||
|
|
||||||
var memory = trim($thisDialog.find("#host_baremetal_memory").val());
|
|
||||||
array1.push("&memory="+todb(memory));
|
|
||||||
|
|
||||||
var mac = trim($thisDialog.find("#host_baremetal_mac").val());
|
|
||||||
array1.push("&hostmac="+todb(mac));
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
var username = trim($thisDialog.find("#host_username").val());
|
var username = trim($thisDialog.find("#host_username").val());
|
||||||
array1.push("&username="+todb(username));
|
array1.push("&username="+todb(username));
|
||||||
|
|
||||||
@ -977,6 +983,27 @@ function initAddHostShortcut() {
|
|||||||
else
|
else
|
||||||
url = hostname;
|
url = hostname;
|
||||||
array1.push("&url="+todb(url));
|
array1.push("&url="+todb(url));
|
||||||
|
|
||||||
|
if (hypervisor == "BareMetal") {
|
||||||
|
var cpuCores = trim($thisDialog.find("#host_baremetal_cpucores").val());
|
||||||
|
array1.push("&cpunumber="+todb(cpuCores));
|
||||||
|
|
||||||
|
var cpuSpeed = trim($thisDialog.find("#host_baremetal_cpu").val());
|
||||||
|
array1.push("&cpuspeed="+todb(cpuSpeed));
|
||||||
|
|
||||||
|
var memory = trim($thisDialog.find("#host_baremetal_memory").val());
|
||||||
|
array1.push("&memory="+todb(memory));
|
||||||
|
|
||||||
|
var mac = trim($thisDialog.find("#host_baremetal_mac").val());
|
||||||
|
array1.push("&hostmac="+todb(mac));
|
||||||
|
}
|
||||||
|
else if(hypervisor == "Ovm") {
|
||||||
|
var agentUsername = $thisDialog.find("#agent_username").val();
|
||||||
|
array1.push("&agentusername="+todb(agentUsername));
|
||||||
|
|
||||||
|
var agentPassword = $thisDialog.find("#agent_password").val();
|
||||||
|
array1.push("&agentpassword="+todb(agentPassword));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -1928,6 +1955,10 @@ function bindEventHandlerToDialogAddPool($dialogAddPool) {
|
|||||||
$protocolSelector.append('<option value="nfs">' + g_dictionary["label.nfs"] + '</option>');
|
$protocolSelector.append('<option value="nfs">' + g_dictionary["label.nfs"] + '</option>');
|
||||||
$protocolSelector.append('<option value="vmfs">' + g_dictionary["label.VMFS.datastore"] + '</option>');
|
$protocolSelector.append('<option value="vmfs">' + g_dictionary["label.VMFS.datastore"] + '</option>');
|
||||||
}
|
}
|
||||||
|
else if(clusterObj.hypervisortype == "Ovm") {
|
||||||
|
$protocolSelector.empty();
|
||||||
|
$protocolSelector.append('<option value="nfs">' + g_dictionary["label.nfs"] + '</option>');
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
$protocolSelector.empty();
|
$protocolSelector.empty();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -84,7 +84,8 @@ function afterLoadTemplateJSP() {
|
|||||||
formatSelect.append("<option value='QCOW2'>QCOW2</option>");
|
formatSelect.append("<option value='QCOW2'>QCOW2</option>");
|
||||||
else if(selectedHypervisorType == "BareMetal")
|
else if(selectedHypervisorType == "BareMetal")
|
||||||
formatSelect.append("<option value='BareMetal'>BareMetal</option>");
|
formatSelect.append("<option value='BareMetal'>BareMetal</option>");
|
||||||
|
else if(selectedHypervisorType == "Ovm")
|
||||||
|
formatSelect.append("<option value='RAW'>RAW</option>");
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -755,19 +755,31 @@ function bindAddHostButtonOnZonePage($button, zoneId, zoneName) {
|
|||||||
if(clusterId == null)
|
if(clusterId == null)
|
||||||
return;
|
return;
|
||||||
var clusterObj = clustersUnderOnePod[clusterId];
|
var clusterObj = clustersUnderOnePod[clusterId];
|
||||||
|
|
||||||
if(clusterObj.hypervisortype == "VMware") {
|
if(clusterObj.hypervisortype == "VMware") {
|
||||||
$('li[input_group="vmware"]', $dialogAddHost).show();
|
$('li[input_group="vmware"]', $dialogAddHost).show();
|
||||||
$('li[input_group="general"]', $dialogAddHost).hide();
|
$('li[input_group="general"]', $dialogAddHost).hide();
|
||||||
$('li[input_group="baremetal"]', $dialogAddHost).hide();
|
$('li[input_group="baremetal"]', $dialogAddHost).hide();
|
||||||
} else if (clusterObj.hypervisortype == "BareMetal") {
|
$('li[input_group="Ovm"]', $dialogAddHost).hide();
|
||||||
$('li[input_group="vmware"]', $dialogAddHost).hide();
|
}
|
||||||
$('li[input_group="general"]', $dialogAddHost).show();
|
else if (clusterObj.hypervisortype == "BareMetal") {
|
||||||
$('li[input_group="baremetal"]', $dialogAddHost).show();
|
$('li[input_group="baremetal"]', $dialogAddHost).show();
|
||||||
} else {
|
|
||||||
$('li[input_group="vmware"]', $dialogAddHost).hide();
|
|
||||||
$('li[input_group="general"]', $dialogAddHost).show();
|
$('li[input_group="general"]', $dialogAddHost).show();
|
||||||
|
$('li[input_group="vmware"]', $dialogAddHost).hide();
|
||||||
|
$('li[input_group="Ovm"]', $dialogAddHost).hide();
|
||||||
|
}
|
||||||
|
else if (clusterObj.hypervisortype == "Ovm") {
|
||||||
|
$('li[input_group="Ovm"]', $dialogAddHost).show();
|
||||||
|
$('li[input_group="general"]', $dialogAddHost).show();
|
||||||
|
$('li[input_group="vmware"]', $dialogAddHost).hide();
|
||||||
$('li[input_group="baremetal"]', $dialogAddHost).hide();
|
$('li[input_group="baremetal"]', $dialogAddHost).hide();
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$('li[input_group="general"]', $dialogAddHost).show();
|
||||||
|
$('li[input_group="vmware"]', $dialogAddHost).hide();
|
||||||
|
$('li[input_group="baremetal"]', $dialogAddHost).hide();
|
||||||
|
$('li[input_group="Ovm"]', $dialogAddHost).hide();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$button.unbind("click").bind("click", function(event) {
|
$button.unbind("click").bind("click", function(event) {
|
||||||
@ -800,16 +812,22 @@ function bindAddHostButtonOnZonePage($button, zoneId, zoneName) {
|
|||||||
isValid &= validateString("vCenter Datacenter", $thisDialog.find("#host_vcenter_dc"), $thisDialog.find("#host_vcenter_dc_errormsg"));
|
isValid &= validateString("vCenter Datacenter", $thisDialog.find("#host_vcenter_dc"), $thisDialog.find("#host_vcenter_dc_errormsg"));
|
||||||
*/
|
*/
|
||||||
isValid &= validateString("vCenter Host", $thisDialog.find("#host_vcenter_host"), $thisDialog.find("#host_vcenter_host_errormsg"));
|
isValid &= validateString("vCenter Host", $thisDialog.find("#host_vcenter_host"), $thisDialog.find("#host_vcenter_host_errormsg"));
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
|
isValid &= validateString("Host name", $thisDialog.find("#host_hostname"), $thisDialog.find("#host_hostname_errormsg"));
|
||||||
|
isValid &= validateString("User name", $thisDialog.find("#host_username"), $thisDialog.find("#host_username_errormsg"));
|
||||||
|
isValid &= validateString("Password", $thisDialog.find("#host_password"), $thisDialog.find("#host_password_errormsg"));
|
||||||
|
|
||||||
if (hypervisor == "BareMetal") {
|
if (hypervisor == "BareMetal") {
|
||||||
isValid &= validateString("CPU Cores", $thisDialog.find("#host_baremetal_cpucores"), $thisDialog.find("#host_baremetal_cpucores_errormsg"));
|
isValid &= validateString("CPU Cores", $thisDialog.find("#host_baremetal_cpucores"), $thisDialog.find("#host_baremetal_cpucores_errormsg"));
|
||||||
isValid &= validateString("CPU", $thisDialog.find("#host_baremetal_cpu"), $thisDialog.find("#host_baremetal_cpu_errormsg"));
|
isValid &= validateString("CPU", $thisDialog.find("#host_baremetal_cpu"), $thisDialog.find("#host_baremetal_cpu_errormsg"));
|
||||||
isValid &= validateString("Memory", $thisDialog.find("#host_baremetal_memory"), $thisDialog.find("#host_baremetal_memory_errormsg"));
|
isValid &= validateString("Memory", $thisDialog.find("#host_baremetal_memory"), $thisDialog.find("#host_baremetal_memory_errormsg"));
|
||||||
isValid &= validateString("MAC", $thisDialog.find("#host_baremetal_mac"), $thisDialog.find("#host_baremetal_mac_errormsg"));
|
isValid &= validateString("MAC", $thisDialog.find("#host_baremetal_mac"), $thisDialog.find("#host_baremetal_mac_errormsg"));
|
||||||
}
|
}
|
||||||
isValid &= validateString("Host name", $thisDialog.find("#host_hostname"), $thisDialog.find("#host_hostname_errormsg"));
|
else if(hypervisor == "Ovm") {
|
||||||
isValid &= validateString("User name", $thisDialog.find("#host_username"), $thisDialog.find("#host_username_errormsg"));
|
isValid &= validateString("Agent Username", $thisDialog.find("#agent_username"), $thisDialog.find("#agent_username_errormsg"), true); //optional
|
||||||
isValid &= validateString("Password", $thisDialog.find("#host_password"), $thisDialog.find("#host_password_errormsg"));
|
isValid &= validateString("Agent Password", $thisDialog.find("#agent_password"), $thisDialog.find("#agent_password_errormsg"), false); //required
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!isValid)
|
if (!isValid)
|
||||||
@ -860,21 +878,8 @@ function bindAddHostButtonOnZonePage($button, zoneId, zoneName) {
|
|||||||
url = hostname;
|
url = hostname;
|
||||||
array1.push("&url="+todb(url));
|
array1.push("&url="+todb(url));
|
||||||
|
|
||||||
} else {
|
|
||||||
if (hypervisor == "BareMetal") {
|
|
||||||
var cpuCores = trim($thisDialog.find("#host_baremetal_cpucores").val());
|
|
||||||
array1.push("&cpunumber="+todb(cpuCores));
|
|
||||||
|
|
||||||
var cpuSpeed = trim($thisDialog.find("#host_baremetal_cpu").val());
|
|
||||||
array1.push("&cpuspeed="+todb(cpuSpeed));
|
|
||||||
|
|
||||||
var memory = trim($thisDialog.find("#host_baremetal_memory").val());
|
|
||||||
array1.push("&memory="+todb(memory));
|
|
||||||
|
|
||||||
var mac = trim($thisDialog.find("#host_baremetal_mac").val());
|
|
||||||
array1.push("&hostmac="+todb(mac));
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
var username = trim($thisDialog.find("#host_username").val());
|
var username = trim($thisDialog.find("#host_username").val());
|
||||||
array1.push("&username="+todb(username));
|
array1.push("&username="+todb(username));
|
||||||
|
|
||||||
@ -888,6 +893,27 @@ function bindAddHostButtonOnZonePage($button, zoneId, zoneName) {
|
|||||||
else
|
else
|
||||||
url = hostname;
|
url = hostname;
|
||||||
array1.push("&url="+todb(url));
|
array1.push("&url="+todb(url));
|
||||||
|
|
||||||
|
if (hypervisor == "BareMetal") {
|
||||||
|
var cpuCores = trim($thisDialog.find("#host_baremetal_cpucores").val());
|
||||||
|
array1.push("&cpunumber="+todb(cpuCores));
|
||||||
|
|
||||||
|
var cpuSpeed = trim($thisDialog.find("#host_baremetal_cpu").val());
|
||||||
|
array1.push("&cpuspeed="+todb(cpuSpeed));
|
||||||
|
|
||||||
|
var memory = trim($thisDialog.find("#host_baremetal_memory").val());
|
||||||
|
array1.push("&memory="+todb(memory));
|
||||||
|
|
||||||
|
var mac = trim($thisDialog.find("#host_baremetal_mac").val());
|
||||||
|
array1.push("&hostmac="+todb(mac));
|
||||||
|
}
|
||||||
|
else if(hypervisor == "Ovm") {
|
||||||
|
var agentUsername = $thisDialog.find("#agent_username").val();
|
||||||
|
array1.push("&agentusername="+todb(agentUsername));
|
||||||
|
|
||||||
|
var agentPassword = $thisDialog.find("#agent_password").val();
|
||||||
|
array1.push("&agentpassword="+todb(agentPassword));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|||||||
@ -65,4 +65,5 @@ public interface SerialVersionUID {
|
|||||||
public static final long DiscoveredWithErrorException = Base | 0x25;
|
public static final long DiscoveredWithErrorException = Base | 0x25;
|
||||||
public static final long NoTransitionException = Base | 0x26;
|
public static final long NoTransitionException = Base | 0x26;
|
||||||
public static final long CloudExecutionException = Base | 0x27;
|
public static final long CloudExecutionException = Base | 0x27;
|
||||||
|
public static final long CallFailedException = Base | 0x26;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -261,7 +261,7 @@ depsclasspath = [ in_javadir(_basename(x)) for x in _glob(_join(conf.srcdir,"dep
|
|||||||
conf.env.DEPSCLASSPATH = pathsep.join(depsclasspath)
|
conf.env.DEPSCLASSPATH = pathsep.join(depsclasspath)
|
||||||
|
|
||||||
# the MS classpath points to JARs required to run the management server
|
# the MS classpath points to JARs required to run the management server
|
||||||
msclasspath = [ in_javadir("%s-%s.jar"%(conf.env.PACKAGE,x)) for x in "utils api core server server-extras core-extras vmware-base".split() ]
|
msclasspath = [ in_javadir("%s-%s.jar"%(conf.env.PACKAGE,x)) for x in "utils api core server server-extras core-extras vmware-base ovm".split() ]
|
||||||
conf.env.MSCLASSPATH = pathsep.join(msclasspath)
|
conf.env.MSCLASSPATH = pathsep.join(msclasspath)
|
||||||
|
|
||||||
# the agent and simulator classpaths point to JARs required to run these two applications
|
# the agent and simulator classpaths point to JARs required to run these two applications
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user