mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge branch '4.11'
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
commit
4277b92abe
@ -78,4 +78,16 @@ UPDATE `cloud`.`guest_os_hypervisor` SET `guest_os_name`='debian5_64Guest' WHERE
|
||||
UPDATE `cloud`.`guest_os_hypervisor` SET `guest_os_name`='debian5_64Guest' WHERE `hypervisor_version`='5.1' AND hypervisor_type='VMware' AND guest_os_id='15';
|
||||
UPDATE `cloud`.`guest_os_hypervisor` SET `guest_os_name`='debian5_64Guest' WHERE `hypervisor_version`='5.5' AND hypervisor_type='VMware' AND guest_os_id='15';
|
||||
UPDATE `cloud`.`guest_os_hypervisor` SET `guest_os_name`='debian5_64Guest' WHERE `hypervisor_version`='6.0' AND hypervisor_type='VMware' AND guest_os_id='15';
|
||||
UPDATE `cloud`.`guest_os_hypervisor` SET `guest_os_name`='debian5_64Guest' WHERE `hypervisor_version`='6.5' AND hypervisor_type='VMware' AND guest_os_id='15';
|
||||
UPDATE `cloud`.`guest_os_hypervisor` SET `guest_os_name`='debian5_64Guest' WHERE `hypervisor_version`='6.5' AND hypervisor_type='VMware' AND guest_os_id='15';
|
||||
|
||||
-- XenServer 7.3
|
||||
INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid, hypervisor_type, hypervisor_version, max_guests_limit, max_data_volumes_limit, storage_motion_supported) values (UUID(), 'XenServer', '7.3.0', 500, 13, 1);
|
||||
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) SELECT UUID(),'Xenserver', '7.3.0', guest_os_name, guest_os_id, utc_timestamp(), 0 FROM `cloud`.`guest_os_hypervisor` WHERE hypervisor_type='Xenserver' AND hypervisor_version='7.2.0';
|
||||
|
||||
-- XenServer 7.4
|
||||
INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid, hypervisor_type, hypervisor_version, max_guests_limit, max_data_volumes_limit, storage_motion_supported) values (UUID(), 'XenServer', '7.4.0', 500, 13, 1);
|
||||
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) SELECT UUID(),'Xenserver', '7.4.0', guest_os_name, guest_os_id, utc_timestamp(), 0 FROM `cloud`.`guest_os_hypervisor` WHERE hypervisor_type='Xenserver' AND hypervisor_version='7.3.0';
|
||||
|
||||
-- XCP-NG 7.4
|
||||
INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid, hypervisor_type, hypervisor_version, max_guests_limit, max_data_volumes_limit, storage_motion_supported) values (UUID(), 'XenServer', 'XCP-ng 7.4.0', 500, 13, 1);
|
||||
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) SELECT UUID(),'Xenserver', 'XCP-ng 7.4.0', guest_os_name, guest_os_id, utc_timestamp(), 0 FROM `cloud`.`guest_os_hypervisor` WHERE hypervisor_type='Xenserver' AND hypervisor_version='7.4.0';
|
||||
|
||||
@ -423,7 +423,7 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L
|
||||
}
|
||||
} else if (prodBrand.equals("XCP_Kronos")) {
|
||||
return new XcpOssResource();
|
||||
} else if (prodBrand.equals("XenServer")) {
|
||||
} else if (prodBrand.equals("XenServer") || prodBrand.equals("XCP-ng")) {
|
||||
final String[] items = prodVersion.split("\\.");
|
||||
if ((Integer.parseInt(items[0]) > 6) ||
|
||||
(Integer.parseInt(items[0]) == 6 && Integer.parseInt(items[1]) >= 4)) {
|
||||
|
||||
@ -1052,9 +1052,13 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
|
||||
public VBD createPatchVbd(final Connection conn, final String vmName, final VM vm) throws XmlRpcException, XenAPIException {
|
||||
|
||||
if (_host.getSystemvmisouuid() == null) {
|
||||
final Set<SR> srs = SR.getByNameLabel(conn, "XenServer Tools");
|
||||
Set<SR> srs = SR.getByNameLabel(conn, "XenServer Tools");
|
||||
if (srs.size() != 1) {
|
||||
throw new CloudRuntimeException("There are " + srs.size() + " SRs with name XenServer Tools");
|
||||
s_logger.debug("Failed to find SR by name 'XenServer Tools', will try to find 'XCP-ng Tools' SR");
|
||||
srs = SR.getByNameLabel(conn, "XCP-ng Tools");
|
||||
if (srs.size() != 1) {
|
||||
throw new CloudRuntimeException("There are " + srs.size() + " SRs with name XenServer Tools");
|
||||
}
|
||||
}
|
||||
final SR sr = srs.iterator().next();
|
||||
sr.scan(conn);
|
||||
@ -2632,7 +2636,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
|
||||
String xenVersion = record.softwareVersion.get("product_version");
|
||||
String[] items = xenVersion.split("\\.");
|
||||
|
||||
if (xenBrand.equals("XenServer") && Integer.parseInt(items[0]) >= 7) {
|
||||
if ((xenBrand.equals("XenServer") || xenBrand.equals("XCP-ng")) && Integer.parseInt(items[0]) >= 7) {
|
||||
return xenServer70plusGuestToolsName;
|
||||
}
|
||||
return xenServerBefore70GuestToolsName;
|
||||
|
||||
@ -79,6 +79,7 @@ import com.cloud.agent.api.to.SwiftTO;
|
||||
import com.cloud.exception.InternalErrorException;
|
||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase.SRType;
|
||||
import com.cloud.hypervisor.xenserver.resource.wrapper.xenbase.XenServerUtilitiesHelper;
|
||||
import com.cloud.storage.DataStoreRole;
|
||||
import com.cloud.storage.Storage;
|
||||
import com.cloud.storage.Storage.ImageFormat;
|
||||
@ -410,7 +411,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
if (!sr.getNameLabel(conn).startsWith("XenServer Tools")) {
|
||||
if (!XenServerUtilitiesHelper.isXenServerToolsSR(sr.getNameLabel(conn))) {
|
||||
hypervisorResource.removeSR(conn, sr);
|
||||
}
|
||||
|
||||
|
||||
@ -119,7 +119,7 @@ public final class CitrixAttachIsoCommandWrapper extends CommandWrapper<AttachIs
|
||||
}
|
||||
}
|
||||
|
||||
if (!sr.getNameLabel(conn).startsWith("XenServer Tools")) {
|
||||
if (!XenServerUtilitiesHelper.isXenServerToolsSR(sr.getNameLabel(conn))) {
|
||||
citrixResourceBase.removeSR(conn, sr);
|
||||
}
|
||||
|
||||
|
||||
@ -20,6 +20,7 @@ import java.io.File;
|
||||
|
||||
import com.cloud.utils.Pair;
|
||||
import com.cloud.utils.ssh.SshHelper;
|
||||
import com.google.common.base.Strings;
|
||||
|
||||
|
||||
/**
|
||||
@ -42,4 +43,8 @@ public class XenServerUtilitiesHelper {
|
||||
|
||||
return cmdLine.toString();
|
||||
}
|
||||
|
||||
public static boolean isXenServerToolsSR(final String label) {
|
||||
return !Strings.isNullOrEmpty(label) && (label.startsWith("XenServer Tools") || label.startsWith("XCP-ng Tools"));
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
[Unit]
|
||||
Description=CloudStack post-patching init script
|
||||
After=cloud-early-config.service network.target local-fs.target
|
||||
Before=ssh.service apache2.service
|
||||
Before=ssh.service
|
||||
Requires=network.service
|
||||
|
||||
[Install]
|
||||
|
||||
@ -51,7 +51,7 @@ class CsApache(CsApp):
|
||||
file.search("ServerName.*", "\tServerName %s.%s" % (self.config.cl.get_type(), self.config.get_domain()))
|
||||
if file.is_changed():
|
||||
file.commit()
|
||||
CsHelper.service("apache2", "restart")
|
||||
CsHelper.execute2("systemctl restart apache2", False)
|
||||
|
||||
self.fw.append([
|
||||
"", "front",
|
||||
|
||||
@ -213,11 +213,12 @@ def save_iptables(command, iptables_file):
|
||||
fIptables.close()
|
||||
|
||||
|
||||
def execute2(command):
|
||||
def execute2(command, wait=True):
|
||||
""" Execute command """
|
||||
logging.debug("Executing: %s" % command)
|
||||
p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||
p.wait()
|
||||
if wait:
|
||||
p.wait()
|
||||
return p
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user