mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Bug 4061: support for Microsoft Hyper-V changes- part 1
This commit is contained in:
parent
d431f70447
commit
1b251a5fc8
@ -25,6 +25,7 @@ public class Hypervisor {
|
|||||||
XenServer,
|
XenServer,
|
||||||
KVM,
|
KVM,
|
||||||
VMware,
|
VMware,
|
||||||
|
Hyperv,
|
||||||
VirtualBox,
|
VirtualBox,
|
||||||
Parralels,
|
Parralels,
|
||||||
BareMetal,
|
BareMetal,
|
||||||
@ -45,6 +46,8 @@ public class Hypervisor {
|
|||||||
return HypervisorType.KVM;
|
return HypervisorType.KVM;
|
||||||
} else if (hypervisor.equalsIgnoreCase("VMware")) {
|
} else if (hypervisor.equalsIgnoreCase("VMware")) {
|
||||||
return HypervisorType.VMware;
|
return HypervisorType.VMware;
|
||||||
|
} else if (hypervisor.equalsIgnoreCase("Hyperv")) {
|
||||||
|
return HypervisorType.Hyperv;
|
||||||
} else if (hypervisor.equalsIgnoreCase("VirtualBox")) {
|
} else if (hypervisor.equalsIgnoreCase("VirtualBox")) {
|
||||||
return HypervisorType.VirtualBox;
|
return HypervisorType.VirtualBox;
|
||||||
} else if (hypervisor.equalsIgnoreCase("Parralels")) {
|
} else if (hypervisor.equalsIgnoreCase("Parralels")) {
|
||||||
|
|||||||
@ -68,6 +68,13 @@ get_boot_params() {
|
|||||||
vmware)
|
vmware)
|
||||||
vmtoolsd --cmd 'machine.id.get' > /var/cache/cloud/cmdline
|
vmtoolsd --cmd 'machine.id.get' > /var/cache/cloud/cmdline
|
||||||
;;
|
;;
|
||||||
|
virtualpc)
|
||||||
|
# Hyper-V is recognized as virtualpc hypervisor type. Boot args are passed in the NTFS data-disk
|
||||||
|
mkdir -p $EXTRA_MOUNT
|
||||||
|
mount -t ntfs /dev/sdb1 $EXTRA_MOUNT
|
||||||
|
cp -f $EXTRA_MOUNT/cmdline /var/cache/cloud/cmdline
|
||||||
|
umount $EXTRA_MOUNT
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -733,6 +733,12 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory,
|
|||||||
if (resources != null) {
|
if (resources != null) {
|
||||||
for (Map.Entry<? extends ServerResource, Map<String, String>> entry : resources.entrySet()) {
|
for (Map.Entry<? extends ServerResource, Map<String, String>> entry : resources.entrySet()) {
|
||||||
ServerResource resource = entry.getKey();
|
ServerResource resource = entry.getKey();
|
||||||
|
|
||||||
|
// For Hyper-V, we are here means agent have already started and connected to management server
|
||||||
|
if (hypervisorType == Hypervisor.HypervisorType.Hyperv) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
AgentAttache attache = simulateStart(resource, entry.getValue(), true, null, null);
|
AgentAttache attache = simulateStart(resource, entry.getValue(), true, null, null);
|
||||||
if (attache != null) {
|
if (attache != null) {
|
||||||
hosts.add(_hostDao.findById(attache.getId()));
|
hosts.add(_hostDao.findById(attache.getId()));
|
||||||
|
|||||||
@ -55,6 +55,7 @@ import com.cloud.exception.StorageUnavailableException;
|
|||||||
import com.cloud.host.Host;
|
import com.cloud.host.Host;
|
||||||
import com.cloud.host.HostVO;
|
import com.cloud.host.HostVO;
|
||||||
import com.cloud.host.dao.HostDao;
|
import com.cloud.host.dao.HostDao;
|
||||||
|
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||||
import com.cloud.info.RunningHostCountInfo;
|
import com.cloud.info.RunningHostCountInfo;
|
||||||
import com.cloud.info.RunningHostInfoAgregator;
|
import com.cloud.info.RunningHostInfoAgregator;
|
||||||
import com.cloud.info.RunningHostInfoAgregator.ZoneHostInfo;
|
import com.cloud.info.RunningHostInfoAgregator.ZoneHostInfo;
|
||||||
@ -860,9 +861,12 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
|
|||||||
}
|
}
|
||||||
|
|
||||||
buf.append(" mount.path=").append(nfsMountPoint);
|
buf.append(" mount.path=").append(nfsMountPoint);
|
||||||
if(_configDao.isPremium())
|
if(_configDao.isPremium()) {
|
||||||
|
if (profile.getHypervisorType() == HypervisorType.Hyperv) {
|
||||||
|
buf.append(" resource=com.cloud.storage.resource.CifsSecondaryStorageResource");
|
||||||
|
} else
|
||||||
buf.append(" resource=com.cloud.storage.resource.PremiumSecondaryStorageResource");
|
buf.append(" resource=com.cloud.storage.resource.PremiumSecondaryStorageResource");
|
||||||
else
|
} else
|
||||||
buf.append(" resource=com.cloud.storage.resource.NfsSecondaryStorageResource");
|
buf.append(" resource=com.cloud.storage.resource.NfsSecondaryStorageResource");
|
||||||
buf.append(" instance=SecStorage");
|
buf.append(" instance=SecStorage");
|
||||||
buf.append(" sslcopy=").append(Boolean.toString(_useSSlCopy));
|
buf.append(" sslcopy=").append(Boolean.toString(_useSSlCopy));
|
||||||
|
|||||||
@ -15,6 +15,9 @@ INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type,
|
|||||||
INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type)
|
INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type)
|
||||||
VALUES (8, 'routing-8', 'SystemVM Template (vSphere)', 0, now(), 'SYSTEM', 0, 32, 1, 'http://download.cloud.com/releases/2.2.0/systemvm.ova', '3c9d4c704af44ebd1736e1bc78cec1fa', 0, 'SystemVM Template (vSphere)', 'OVA', 15, 0, 1, 'VMware');
|
VALUES (8, 'routing-8', 'SystemVM Template (vSphere)', 0, now(), 'SYSTEM', 0, 32, 1, 'http://download.cloud.com/releases/2.2.0/systemvm.ova', '3c9d4c704af44ebd1736e1bc78cec1fa', 0, 'SystemVM Template (vSphere)', 'OVA', 15, 0, 1, 'VMware');
|
||||||
|
|
||||||
|
INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type)
|
||||||
|
VALUES (9, 'routing-9', 'SystemVM Template (HyperV)', 0, now(), 'SYSTEM', 0, 32, 1, 'http://download.cloud.com/releases/2.2.0/systemvm.vhd.bz2', 'c33dfaf0937b35c25ef6a0fdd98f24d3', 0, 'SystemVM Template (HyperV)', 'VHD', 15, 0, 1, 'Hyperv');
|
||||||
|
|
||||||
INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (1, 'CentOS');
|
INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (1, 'CentOS');
|
||||||
INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (2, 'Debian');
|
INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (2, 'Debian');
|
||||||
INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (3, 'Oracle');
|
INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (3, 'Oracle');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user