diff --git a/api/src/com/cloud/hypervisor/Hypervisor.java b/api/src/com/cloud/hypervisor/Hypervisor.java index e5fd672dc2b..82d57a3105c 100644 --- a/api/src/com/cloud/hypervisor/Hypervisor.java +++ b/api/src/com/cloud/hypervisor/Hypervisor.java @@ -25,6 +25,7 @@ public class Hypervisor { XenServer, KVM, VMware, + Hyperv, VirtualBox, Parralels, BareMetal, @@ -45,6 +46,8 @@ public class Hypervisor { return HypervisorType.KVM; } else if (hypervisor.equalsIgnoreCase("VMware")) { return HypervisorType.VMware; + } else if (hypervisor.equalsIgnoreCase("Hyperv")) { + return HypervisorType.Hyperv; } else if (hypervisor.equalsIgnoreCase("VirtualBox")) { return HypervisorType.VirtualBox; } else if (hypervisor.equalsIgnoreCase("Parralels")) { diff --git a/patches/systemvm/debian/config/etc/init.d/cloud-early-config b/patches/systemvm/debian/config/etc/init.d/cloud-early-config index 7b402ec6755..3ce0f4e82f2 100755 --- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config +++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config @@ -68,6 +68,13 @@ get_boot_params() { vmware) 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 } diff --git a/server/src/com/cloud/agent/manager/AgentManagerImpl.java b/server/src/com/cloud/agent/manager/AgentManagerImpl.java index 5ad49b5542a..73d29b5b3aa 100755 --- a/server/src/com/cloud/agent/manager/AgentManagerImpl.java +++ b/server/src/com/cloud/agent/manager/AgentManagerImpl.java @@ -733,6 +733,12 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, if (resources != null) { for (Map.Entry> entry : resources.entrySet()) { 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); if (attache != null) { hosts.add(_hostDao.findById(attache.getId())); diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java index 6f2a9ab467e..349830354e4 100644 --- a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java +++ b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java @@ -55,6 +55,7 @@ import com.cloud.exception.StorageUnavailableException; import com.cloud.host.Host; import com.cloud.host.HostVO; import com.cloud.host.dao.HostDao; +import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.info.RunningHostCountInfo; import com.cloud.info.RunningHostInfoAgregator; import com.cloud.info.RunningHostInfoAgregator.ZoneHostInfo; @@ -860,9 +861,12 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V } buf.append(" mount.path=").append(nfsMountPoint); - if(_configDao.isPremium()) - buf.append(" resource=com.cloud.storage.resource.PremiumSecondaryStorageResource"); - else + 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"); + } else buf.append(" resource=com.cloud.storage.resource.NfsSecondaryStorageResource"); buf.append(" instance=SecStorage"); buf.append(" sslcopy=").append(Boolean.toString(_useSSlCopy)); diff --git a/setup/db/templates.sql b/setup/db/templates.sql index 1039ca5500e..d293fcead32 100755 --- a/setup/db/templates.sql +++ b/setup/db/templates.sql @@ -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) 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 (2, 'Debian'); INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (3, 'Oracle');