mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge release branch 4.18 to main
* 4.18: Fix PR 7131 bugs and vulnerabilities (#7140)
This commit is contained in:
commit
1d0762e43a
@ -1759,7 +1759,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
||||
}
|
||||
|
||||
public boolean passCmdLine(final String vmName, final String cmdLine) throws InternalErrorException {
|
||||
final Script command = new Script(_patchScriptPath, 300 * 1000, s_logger);
|
||||
final Script command = new Script(_patchScriptPath, 300000, s_logger);
|
||||
String result;
|
||||
command.add("-n", vmName);
|
||||
command.add("-c", cmdLine);
|
||||
|
||||
@ -1427,7 +1427,9 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
|
||||
|
||||
r.ioCtxDestroy(io);
|
||||
} catch (QemuImgException | LibvirtException e) {
|
||||
s_logger.error("Failed to convert from " + srcFile.getFileName() + " to " + destFile.getFileName() + " the error was: " + e.getMessage());
|
||||
String srcFilename = srcFile != null ? srcFile.getFileName() : null;
|
||||
String destFilename = destFile != null ? destFile.getFileName() : null;
|
||||
s_logger.error(String.format("Failed to convert from %s to %s the error was: %s", srcFilename, destFilename, e.getMessage()));
|
||||
newDisk = null;
|
||||
} catch (RadosException e) {
|
||||
s_logger.error("A Ceph RADOS operation failed (" + e.getReturnValue() + "). The error was: " + e.getMessage());
|
||||
|
||||
@ -258,7 +258,7 @@ public class OvmResourceBase implements ServerResource, HypervisorResource {
|
||||
|
||||
_canBridgeFirewall = false;
|
||||
|
||||
s_logger.debug(_canBridgeFirewall ? "OVM host supports security groups." : "OVM host doesn't support security groups.");
|
||||
s_logger.debug("OVM host doesn't support security groups.");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -7541,6 +7541,11 @@ public class VmwareResource extends ServerResourceBase implements StoragePoolRes
|
||||
// prepare network on the host
|
||||
prepareNetworkFromNicInfo((HostMO)targetHyperHost, nic, false, vmTo.getType());
|
||||
}
|
||||
|
||||
if (targetHyperHost == null) {
|
||||
throw new CloudRuntimeException(String.format("Trying to relocate VM [%s], but target hyper host is null.", vmTo.getUuid()));
|
||||
}
|
||||
|
||||
// Ensure secondary storage mounted on target host
|
||||
VmwareManager mgr = targetHyperHost.getContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
|
||||
Pair<String, Long> secStoreUrlAndId = mgr.getSecondaryStorageStoreUrlAndId(Long.parseLong(_dcId));
|
||||
|
||||
@ -210,7 +210,8 @@ public class XenServerConnectionPool {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("connect through IP(" + mConn.getIp() + " for pool(" + poolUuid + ") is broken due to " + e.toString());
|
||||
String ip = mConn != null ? mConn.getIp() : null;
|
||||
s_logger.debug("connect through IP(" + ip + ") for pool(" + poolUuid + ") is broken due to " + e.toString());
|
||||
}
|
||||
removeConnect(poolUuid);
|
||||
mConn = null;
|
||||
|
||||
@ -21,6 +21,7 @@ import java.util.Map;
|
||||
import javax.inject.Inject;
|
||||
import javax.naming.ConfigurationException;
|
||||
|
||||
import org.apache.cloudstack.alert.AlertService;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -60,86 +61,94 @@ public class ConsoleProxyAlertAdapter extends AdapterBase implements AlertAdapte
|
||||
throw new CloudRuntimeException("Invalid alert arguments, proxy must be set");
|
||||
}
|
||||
|
||||
String proxyHostName = "";
|
||||
String proxyPublicIpAddress = "";
|
||||
String proxyPrivateIpAddress = "N/A";
|
||||
Long proxyPodIdToDeployIn = null;
|
||||
|
||||
if (proxy != null) {
|
||||
proxyHostName = proxy.getHostName();
|
||||
proxyPublicIpAddress = proxy.getPublicIpAddress();
|
||||
proxyPrivateIpAddress = proxy.getPrivateIpAddress() == null ? "N/A" : proxy.getPrivateIpAddress();
|
||||
proxyPodIdToDeployIn = proxy.getPodIdToDeployIn();
|
||||
}
|
||||
|
||||
String message = "";
|
||||
String zoneProxyPublicAndPrivateIp = String.format("zone [%s], proxy [%s], public IP [%s], private IP [%s].", dc.getName(), proxyHostName, proxyPublicIpAddress,
|
||||
proxyPrivateIpAddress);
|
||||
String zone = String.format("(zone %s)", dc.getName());
|
||||
String errorDetails = " Error details: " + args.getMessage();
|
||||
|
||||
|
||||
switch (args.getType()) {
|
||||
case ConsoleProxyAlertEventArgs.PROXY_CREATED:
|
||||
if (s_logger.isDebugEnabled())
|
||||
s_logger.debug("New console proxy created, zone: " + dc.getName() + ", proxy: " + proxy.getHostName() + ", public IP: " + proxy.getPublicIpAddress() +
|
||||
", private IP: " + proxy.getPrivateIpAddress());
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("New console proxy created, " + zoneProxyPublicAndPrivateIp);
|
||||
}
|
||||
break;
|
||||
|
||||
case ConsoleProxyAlertEventArgs.PROXY_UP:
|
||||
if (s_logger.isDebugEnabled())
|
||||
s_logger.debug("Console proxy is up, zone: " + dc.getName() + ", proxy: " + proxy.getHostName() + ", public IP: " + proxy.getPublicIpAddress() +
|
||||
", private IP: " + proxy.getPrivateIpAddress());
|
||||
message = "Console proxy up in " + zoneProxyPublicAndPrivateIp;
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug(message);
|
||||
}
|
||||
|
||||
_alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_CONSOLE_PROXY, args.getZoneId(), proxy.getPodIdToDeployIn(),
|
||||
"Console proxy up in zone: " + dc.getName() +
|
||||
", proxy: " + proxy.getHostName() + ", public IP: " + proxy.getPublicIpAddress() + ", private IP: " +
|
||||
(proxy.getPrivateIpAddress() == null ? "N/A" : proxy.getPrivateIpAddress()), "Console proxy up (zone " + dc.getName() + ")");
|
||||
_alertMgr.sendAlert(AlertService.AlertType.ALERT_TYPE_CONSOLE_PROXY, args.getZoneId(), proxyPodIdToDeployIn, message, "Console proxy up " + zone);
|
||||
break;
|
||||
|
||||
case ConsoleProxyAlertEventArgs.PROXY_DOWN:
|
||||
if (s_logger.isDebugEnabled())
|
||||
s_logger.debug("Console proxy is down, zone: " + dc.getName() + ", proxy: " + proxy.getHostName() + ", public IP: " + proxy.getPublicIpAddress() +
|
||||
", private IP: " + (proxy.getPrivateIpAddress() == null ? "N/A" : proxy.getPrivateIpAddress()));
|
||||
message = "Console proxy is down in " + zoneProxyPublicAndPrivateIp;
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug(message);
|
||||
}
|
||||
|
||||
_alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_CONSOLE_PROXY, args.getZoneId(), proxy.getPodIdToDeployIn(),
|
||||
"Console proxy down in zone: " + dc.getName() +
|
||||
", proxy: " + proxy.getHostName() + ", public IP: " + proxy.getPublicIpAddress() + ", private IP: " +
|
||||
(proxy.getPrivateIpAddress() == null ? "N/A" : proxy.getPrivateIpAddress()), "Console proxy down (zone " + dc.getName() + ")");
|
||||
_alertMgr.sendAlert(AlertService.AlertType.ALERT_TYPE_CONSOLE_PROXY, args.getZoneId(), proxyPodIdToDeployIn, message, "Console proxy down " + zone);
|
||||
break;
|
||||
|
||||
case ConsoleProxyAlertEventArgs.PROXY_REBOOTED:
|
||||
if (s_logger.isDebugEnabled())
|
||||
s_logger.debug("Console proxy is rebooted, zone: " + dc.getName() + ", proxy: " + proxy.getHostName() + ", public IP: " + proxy.getPublicIpAddress() +
|
||||
", private IP: " + (proxy.getPrivateIpAddress() == null ? "N/A" : proxy.getPrivateIpAddress()));
|
||||
message = "Console proxy is rebooted in " + zoneProxyPublicAndPrivateIp;
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug(message);
|
||||
}
|
||||
|
||||
_alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_CONSOLE_PROXY, args.getZoneId(), proxy.getPodIdToDeployIn(),
|
||||
"Console proxy rebooted in zone: " + dc.getName() + ", proxy: " + proxy.getHostName() + ", public IP: " + proxy.getPublicIpAddress() +
|
||||
", private IP: " + (proxy.getPrivateIpAddress() == null ? "N/A" : proxy.getPrivateIpAddress()), "Console proxy rebooted (zone " + dc.getName() +
|
||||
")");
|
||||
_alertMgr.sendAlert(AlertService.AlertType.ALERT_TYPE_CONSOLE_PROXY, args.getZoneId(), proxyPodIdToDeployIn, message, "Console proxy rebooted " + zone);
|
||||
break;
|
||||
|
||||
case ConsoleProxyAlertEventArgs.PROXY_CREATE_FAILURE:
|
||||
if (s_logger.isDebugEnabled())
|
||||
s_logger.debug("Console proxy creation failure, zone: " + dc.getName());
|
||||
_alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_CONSOLE_PROXY, args.getZoneId(), null,
|
||||
"Console proxy creation failure. zone: " + dc.getName() + ", error details: " + args.getMessage(),
|
||||
"Console proxy creation failure (zone " + dc.getName() + ")");
|
||||
message = String.format("Console proxy creation failure. Zone [%s].", dc.getName());
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug(message);
|
||||
}
|
||||
|
||||
_alertMgr.sendAlert(AlertService.AlertType.ALERT_TYPE_CONSOLE_PROXY, args.getZoneId(), null, message + errorDetails, "Console proxy creation failure " + zone);
|
||||
break;
|
||||
|
||||
case ConsoleProxyAlertEventArgs.PROXY_START_FAILURE:
|
||||
if (s_logger.isDebugEnabled())
|
||||
s_logger.debug("Console proxy startup failure, zone: " + dc.getName() + ", proxy: " + proxy.getHostName() + ", public IP: " +
|
||||
proxy.getPublicIpAddress() + ", private IP: " + (proxy.getPrivateIpAddress() == null ? "N/A" : proxy.getPrivateIpAddress()));
|
||||
message = "Console proxy startup failure in " + zoneProxyPublicAndPrivateIp;
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug(message);
|
||||
}
|
||||
|
||||
_alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_CONSOLE_PROXY, args.getZoneId(), proxy.getPodIdToDeployIn(),
|
||||
"Console proxy startup failure. zone: " + dc.getName() + ", proxy: " + proxy.getHostName() + ", public IP: " + proxy.getPublicIpAddress() +
|
||||
", private IP: " + (proxy.getPrivateIpAddress() == null ? "N/A" : proxy.getPrivateIpAddress()) + ", error details: " + args.getMessage(),
|
||||
"Console proxy startup failure (zone " + dc.getName() + ")");
|
||||
_alertMgr.sendAlert(AlertService.AlertType.ALERT_TYPE_CONSOLE_PROXY, args.getZoneId(), proxyPodIdToDeployIn, message + errorDetails,
|
||||
"Console proxy startup failure " + zone);
|
||||
break;
|
||||
|
||||
case ConsoleProxyAlertEventArgs.PROXY_FIREWALL_ALERT:
|
||||
if (s_logger.isDebugEnabled())
|
||||
s_logger.debug("Console proxy firewall alert, zone: " + dc.getName() + ", proxy: " + proxy.getHostName() + ", public IP: " +
|
||||
proxy.getPublicIpAddress() + ", private IP: " + (proxy.getPrivateIpAddress() == null ? "N/A" : proxy.getPrivateIpAddress()));
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Console proxy firewall alert, " + zoneProxyPublicAndPrivateIp);
|
||||
}
|
||||
|
||||
_alertMgr.sendAlert(
|
||||
AlertManager.AlertType.ALERT_TYPE_CONSOLE_PROXY,
|
||||
args.getZoneId(),
|
||||
proxy.getPodIdToDeployIn(),
|
||||
"Failed to open console proxy firewall port. zone: " + dc.getName() + ", proxy: " + proxy.getHostName() + ", public IP: " +
|
||||
proxy.getPublicIpAddress() + ", private IP: " + (proxy.getPrivateIpAddress() == null ? "N/A" : proxy.getPrivateIpAddress()),
|
||||
"Console proxy alert (zone " + dc.getName() + ")");
|
||||
_alertMgr.sendAlert(AlertService.AlertType.ALERT_TYPE_CONSOLE_PROXY, args.getZoneId(), proxyPodIdToDeployIn, "Failed to open console proxy firewall port. " +
|
||||
zoneProxyPublicAndPrivateIp, "Console proxy alert " + zone);
|
||||
break;
|
||||
|
||||
case ConsoleProxyAlertEventArgs.PROXY_STORAGE_ALERT:
|
||||
if (s_logger.isDebugEnabled())
|
||||
s_logger.debug("Console proxy storage alert, zone: " + dc.getName() + ", proxy: " + proxy.getHostName() + ", public IP: " +
|
||||
proxy.getPublicIpAddress() + ", private IP: " + proxy.getPrivateIpAddress() + ", message: " + args.getMessage());
|
||||
|
||||
_alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_STORAGE_MISC, args.getZoneId(), proxy.getPodIdToDeployIn(),
|
||||
"Console proxy storage issue. zone: " + dc.getName() + ", message: " + args.getMessage(), "Console proxy alert (zone " + dc.getName() + ")");
|
||||
message = zoneProxyPublicAndPrivateIp + ", message: " + args.getMessage();
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Console proxy storage alert, " + message);
|
||||
}
|
||||
_alertMgr.sendAlert(AlertService.AlertType.ALERT_TYPE_STORAGE_MISC, args.getZoneId(), proxyPodIdToDeployIn, "Console proxy storage issue. " + message,
|
||||
"Console proxy alert " + zone);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,6 +21,7 @@ import java.util.Map;
|
||||
import javax.inject.Inject;
|
||||
import javax.naming.ConfigurationException;
|
||||
|
||||
import org.apache.cloudstack.alert.AlertService;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -59,91 +60,93 @@ public class SecondaryStorageVmAlertAdapter extends AdapterBase implements Alert
|
||||
throw new CloudRuntimeException("Invalid alert arguments, secStorageVm must be set");
|
||||
}
|
||||
|
||||
String secStorageVmHostName = "";
|
||||
String secStorageVmPublicIpAddress = "";
|
||||
String secStorageVmPrivateIpAddress = "N/A";
|
||||
Long secStorageVmPodIdToDeployIn = null;
|
||||
|
||||
if (secStorageVm != null) {
|
||||
secStorageVmHostName = secStorageVm.getHostName();
|
||||
secStorageVmPublicIpAddress = secStorageVm.getPublicIpAddress();
|
||||
secStorageVmPrivateIpAddress = secStorageVm.getPrivateIpAddress() == null ? "N/A" : secStorageVm.getPrivateIpAddress();
|
||||
secStorageVmPodIdToDeployIn = secStorageVm.getPodIdToDeployIn();
|
||||
}
|
||||
String message = "";
|
||||
String zoneSecStorageVmPrivateAndPublicIp = String.format("zone [%s], secStorageVm [%s], public IP [%s], private IP [%s].", dc.getName(), secStorageVmHostName,
|
||||
secStorageVmPublicIpAddress, secStorageVmPrivateIpAddress);
|
||||
String errorDetails = " Error details: " + args.getMessage();
|
||||
String zone = String.format("(zone %s)", dc.getName());
|
||||
|
||||
switch (args.getType()) {
|
||||
case SecStorageVmAlertEventArgs.SSVM_CREATED:
|
||||
if (s_logger.isDebugEnabled())
|
||||
s_logger.debug("New secondary storage vm created, zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getHostName() + ", public IP: " +
|
||||
secStorageVm.getPublicIpAddress() + ", private IP: " + secStorageVm.getPrivateIpAddress());
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("New secondary storage vm created in " + zoneSecStorageVmPrivateAndPublicIp);
|
||||
}
|
||||
break;
|
||||
|
||||
case SecStorageVmAlertEventArgs.SSVM_UP:
|
||||
if (s_logger.isDebugEnabled())
|
||||
s_logger.debug("Secondary Storage Vm is up, zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getHostName() + ", public IP: " +
|
||||
secStorageVm.getPublicIpAddress() + ", private IP: " + secStorageVm.getPrivateIpAddress());
|
||||
message = "Secondary Storage Vm is up in " + zoneSecStorageVmPrivateAndPublicIp;
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug(message);
|
||||
}
|
||||
|
||||
_alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_SSVM, args.getZoneId(), secStorageVm.getPodIdToDeployIn(), "Secondary Storage Vm up in zone: " +
|
||||
dc.getName() + ", secStorageVm: " + secStorageVm.getHostName() + ", public IP: " + secStorageVm.getPublicIpAddress() + ", private IP: " +
|
||||
(secStorageVm.getPrivateIpAddress() == null ? "N/A" : secStorageVm.getPrivateIpAddress()), "Secondary Storage Vm up (zone " + dc.getName() + ")");
|
||||
_alertMgr.sendAlert(AlertService.AlertType.ALERT_TYPE_SSVM, args.getZoneId(), secStorageVmPodIdToDeployIn, message, "Secondary Storage Vm up " + zone);
|
||||
break;
|
||||
|
||||
case SecStorageVmAlertEventArgs.SSVM_DOWN:
|
||||
if (s_logger.isDebugEnabled())
|
||||
s_logger.debug("Secondary Storage Vm is down, zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getHostName() + ", public IP: " +
|
||||
secStorageVm.getPublicIpAddress() + ", private IP: " + (secStorageVm.getPrivateIpAddress() == null ? "N/A" : secStorageVm.getPrivateIpAddress()));
|
||||
message = "Secondary Storage Vm is down in " + zoneSecStorageVmPrivateAndPublicIp;
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug(message);
|
||||
}
|
||||
|
||||
_alertMgr.sendAlert(
|
||||
AlertManager.AlertType.ALERT_TYPE_SSVM,
|
||||
args.getZoneId(),
|
||||
secStorageVm.getPodIdToDeployIn(),
|
||||
"Secondary Storage Vm down in zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getHostName() + ", public IP: " +
|
||||
secStorageVm.getPublicIpAddress() + ", private IP: " + (secStorageVm.getPrivateIpAddress() == null ? "N/A" : secStorageVm.getPrivateIpAddress()),
|
||||
"Secondary Storage Vm down (zone " + dc.getName() + ")");
|
||||
_alertMgr.sendAlert(AlertService.AlertType.ALERT_TYPE_SSVM, args.getZoneId(), secStorageVmPodIdToDeployIn, message, "Secondary Storage Vm down " + zone);
|
||||
break;
|
||||
|
||||
case SecStorageVmAlertEventArgs.SSVM_REBOOTED:
|
||||
if (s_logger.isDebugEnabled())
|
||||
s_logger.debug("Secondary Storage Vm is rebooted, zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getHostName() + ", public IP: " +
|
||||
secStorageVm.getPublicIpAddress() + ", private IP: " + (secStorageVm.getPrivateIpAddress() == null ? "N/A" : secStorageVm.getPrivateIpAddress()));
|
||||
message = "Secondary Storage Vm rebooted in " + zoneSecStorageVmPrivateAndPublicIp;
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug(message);
|
||||
}
|
||||
|
||||
_alertMgr.sendAlert(
|
||||
AlertManager.AlertType.ALERT_TYPE_SSVM,
|
||||
args.getZoneId(),
|
||||
secStorageVm.getPodIdToDeployIn(),
|
||||
"Secondary Storage Vm rebooted in zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getHostName() + ", public IP: " +
|
||||
secStorageVm.getPublicIpAddress() + ", private IP: " + (secStorageVm.getPrivateIpAddress() == null ? "N/A" : secStorageVm.getPrivateIpAddress()),
|
||||
"Secondary Storage Vm rebooted (zone " + dc.getName() + ")");
|
||||
_alertMgr.sendAlert(AlertService.AlertType.ALERT_TYPE_SSVM, args.getZoneId(), secStorageVmPodIdToDeployIn, message, "Secondary Storage Vm rebooted " + zone);
|
||||
break;
|
||||
|
||||
case SecStorageVmAlertEventArgs.SSVM_CREATE_FAILURE:
|
||||
if (s_logger.isDebugEnabled())
|
||||
s_logger.debug("Secondary Storage Vm creation failure, zone: " + dc.getName());
|
||||
message = String.format("Secondary Storage Vm creation failure in zone [%s].", dc.getName());
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug(message);
|
||||
}
|
||||
|
||||
_alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_SSVM, args.getZoneId(), null,
|
||||
"Secondary Storage Vm creation failure. zone: " + dc.getName() + ", error details: " + args.getMessage(),
|
||||
"Secondary Storage Vm creation failure (zone " + dc.getName() + ")");
|
||||
_alertMgr.sendAlert(AlertService.AlertType.ALERT_TYPE_SSVM, args.getZoneId(), null, message + errorDetails,
|
||||
"Secondary Storage Vm creation failure " + zone);
|
||||
break;
|
||||
|
||||
case SecStorageVmAlertEventArgs.SSVM_START_FAILURE:
|
||||
if (s_logger.isDebugEnabled())
|
||||
s_logger.debug("Secondary Storage Vm startup failure, zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getHostName() + ", public IP: " +
|
||||
secStorageVm.getPublicIpAddress() + ", private IP: " + (secStorageVm.getPrivateIpAddress() == null ? "N/A" : secStorageVm.getPrivateIpAddress()));
|
||||
message = "Secondary Storage Vm startup failure in " + zoneSecStorageVmPrivateAndPublicIp;
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug(message);
|
||||
}
|
||||
|
||||
_alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_SSVM, args.getZoneId(), secStorageVm.getPodIdToDeployIn(),
|
||||
"Secondary Storage Vm startup failure. zone: " +
|
||||
dc.getName() + ", secStorageVm: " + secStorageVm.getHostName() + ", public IP: " + secStorageVm.getPublicIpAddress() + ", private IP: " +
|
||||
(secStorageVm.getPrivateIpAddress() == null ? "N/A" : secStorageVm.getPrivateIpAddress()) + ", error details: " + args.getMessage(),
|
||||
"Secondary Storage Vm startup failure (zone " + dc.getName() + ")");
|
||||
_alertMgr.sendAlert(AlertService.AlertType.ALERT_TYPE_SSVM, args.getZoneId(), secStorageVmPodIdToDeployIn, message + errorDetails,
|
||||
"Secondary Storage Vm startup failure " + zone);
|
||||
break;
|
||||
|
||||
case SecStorageVmAlertEventArgs.SSVM_FIREWALL_ALERT:
|
||||
if (s_logger.isDebugEnabled())
|
||||
s_logger.debug("Secondary Storage Vm firewall alert, zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getHostName() + ", public IP: " +
|
||||
secStorageVm.getPublicIpAddress() + ", private IP: " + (secStorageVm.getPrivateIpAddress() == null ? "N/A" : secStorageVm.getPrivateIpAddress()));
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Secondary Storage Vm firewall alert, " + zoneSecStorageVmPrivateAndPublicIp);
|
||||
}
|
||||
|
||||
_alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_SSVM, args.getZoneId(), secStorageVm.getPodIdToDeployIn(),
|
||||
"Failed to open secondary storage vm firewall port. zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getHostName() + ", public IP: " +
|
||||
secStorageVm.getPublicIpAddress() + ", private IP: " + (secStorageVm.getPrivateIpAddress() == null ? "N/A" : secStorageVm.getPrivateIpAddress()),
|
||||
"Secondary Storage Vm alert (zone " + dc.getName() + ")");
|
||||
_alertMgr.sendAlert(AlertService.AlertType.ALERT_TYPE_SSVM, args.getZoneId(), secStorageVmPodIdToDeployIn, "Failed to open secondary storage vm firewall port. "
|
||||
+ zoneSecStorageVmPrivateAndPublicIp, "Secondary Storage Vm alert " + zone);
|
||||
break;
|
||||
|
||||
case SecStorageVmAlertEventArgs.SSVM_STORAGE_ALERT:
|
||||
if (s_logger.isDebugEnabled())
|
||||
s_logger.debug("Secondary Storage Vm storage alert, zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getHostName() + ", public IP: " +
|
||||
secStorageVm.getPublicIpAddress() + ", private IP: " + secStorageVm.getPrivateIpAddress() + ", message: " + args.getMessage());
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Secondary Storage Vm storage alert, " + zoneSecStorageVmPrivateAndPublicIp + ", message: " + args.getMessage());
|
||||
}
|
||||
|
||||
_alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_STORAGE_MISC, args.getZoneId(), secStorageVm.getPodIdToDeployIn(),
|
||||
"Secondary Storage Vm storage issue. zone: " + dc.getName() + ", message: " + args.getMessage(), "Secondary Storage Vm alert (zone " + dc.getName() +
|
||||
")");
|
||||
_alertMgr.sendAlert(AlertService.AlertType.ALERT_TYPE_STORAGE_MISC, args.getZoneId(), secStorageVmPodIdToDeployIn,
|
||||
"Secondary Storage Vm storage issue. zone: " + dc.getName() + ", message: " + args.getMessage(), "Secondary Storage Vm alert " + zone);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -188,6 +188,8 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler, ApiSer
|
||||
private static final Logger s_logger = Logger.getLogger(ApiServer.class.getName());
|
||||
private static final Logger s_accessLogger = Logger.getLogger("apiserver." + ApiServer.class.getName());
|
||||
|
||||
private static final String SANITIZATION_REGEX = "[\n\r]";
|
||||
|
||||
private static boolean encodeApiResponse = false;
|
||||
|
||||
/**
|
||||
@ -919,7 +921,7 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler, ApiSer
|
||||
if ("3".equals(signatureVersion)) {
|
||||
// New signature authentication. Check for expire parameter and its validity
|
||||
if (expires == null) {
|
||||
s_logger.debug("Missing Expires parameter -- ignoring request. Signature: " + signature + ", apiKey: " + apiKey);
|
||||
s_logger.debug("Missing Expires parameter -- ignoring request.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -932,7 +934,9 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler, ApiSer
|
||||
|
||||
final Date now = new Date(System.currentTimeMillis());
|
||||
if (expiresTS.before(now)) {
|
||||
s_logger.debug("Request expired -- ignoring ...sig: " + signature + ", apiKey: " + apiKey);
|
||||
signature = signature.replaceAll(SANITIZATION_REGEX, "_");
|
||||
apiKey = apiKey.replaceAll(SANITIZATION_REGEX, "_");
|
||||
s_logger.debug(String.format("Request expired -- ignoring ...sig [%s], apiKey [%s].", signature, apiKey));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -979,7 +983,8 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler, ApiSer
|
||||
final boolean equalSig = ConstantTimeComparator.compareStrings(signature, computedSignature);
|
||||
|
||||
if (!equalSig) {
|
||||
s_logger.info("User signature: " + signature + " is not equaled to computed signature: " + computedSignature);
|
||||
signature = signature.replaceAll(SANITIZATION_REGEX, "_");
|
||||
s_logger.info(String.format("User signature [%s] is not equaled to computed signature [%s].", signature, computedSignature));
|
||||
} else {
|
||||
CallContext.register(user, account);
|
||||
}
|
||||
|
||||
@ -720,10 +720,10 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
|
||||
DestroyLoadBalancerApplianceAnswer answer = null;
|
||||
try {
|
||||
answer = (DestroyLoadBalancerApplianceAnswer)_agentMgr.easySend(lbDevice.getParentHostId(), lbDeleteCmd);
|
||||
if (answer == null || !answer.getResult()) {
|
||||
s_logger.warn("Failed to destoy load balancer appliance used by the network"
|
||||
+ guestConfig.getId() + " due to " + answer == null ? "communication error with agent"
|
||||
: answer.getDetails());
|
||||
if (answer == null) {
|
||||
s_logger.warn(String.format("Failed to destroy load balancer appliance used by the network [%s] due to a communication error with agent.", guestConfig.getId()));
|
||||
} else if (!answer.getResult()) {
|
||||
s_logger.warn(String.format("Failed to destroy load balancer appliance used by the network [%s] due to [%s].", guestConfig.getId(), answer.getDetails()));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
s_logger.warn("Failed to destroy load balancer appliance used by the network" + guestConfig.getId() + " due to " + e.getMessage());
|
||||
|
||||
@ -71,6 +71,8 @@ public class ConsoleProxyServlet extends HttpServlet {
|
||||
private static final int DEFAULT_THUMBNAIL_WIDTH = 144;
|
||||
private static final int DEFAULT_THUMBNAIL_HEIGHT = 110;
|
||||
|
||||
private static final String SANITIZATION_REGEX = "[\n\r]";
|
||||
|
||||
@Inject
|
||||
AccountManager _accountMgr;
|
||||
@Inject
|
||||
@ -154,7 +156,13 @@ public class ConsoleProxyServlet extends HttpServlet {
|
||||
|
||||
String cmd = req.getParameter("cmd");
|
||||
if (cmd == null || !isValidCmd(cmd)) {
|
||||
s_logger.debug("invalid console servlet command: " + cmd);
|
||||
if (cmd != null) {
|
||||
cmd = cmd.replaceAll(SANITIZATION_REGEX, "_");
|
||||
s_logger.debug(String.format("invalid console servlet command [%s].", cmd));
|
||||
} else {
|
||||
s_logger.debug("Null console servlet command.");
|
||||
}
|
||||
|
||||
sendResponse(resp, "");
|
||||
return;
|
||||
}
|
||||
@ -162,7 +170,13 @@ public class ConsoleProxyServlet extends HttpServlet {
|
||||
String vmIdString = req.getParameter("vm");
|
||||
VirtualMachine vm = _entityMgr.findByUuid(VirtualMachine.class, vmIdString);
|
||||
if (vm == null) {
|
||||
s_logger.info("invalid console servlet command parameter: " + vmIdString);
|
||||
if (vmIdString != null) {
|
||||
vmIdString = vmIdString.replaceAll(SANITIZATION_REGEX, "_");
|
||||
s_logger.info(String.format("invalid console servlet command vm parameter[%s].", vmIdString));
|
||||
} else {
|
||||
s_logger.info("Null console servlet command VM parameter.");
|
||||
}
|
||||
|
||||
sendResponse(resp, "");
|
||||
return;
|
||||
}
|
||||
@ -262,7 +276,13 @@ public class ConsoleProxyServlet extends HttpServlet {
|
||||
|
||||
String sid = req.getParameter("sid");
|
||||
if (sid == null || !sid.equals(vm.getVncPassword())) {
|
||||
s_logger.warn("sid " + sid + " in url does not match stored sid.");
|
||||
if(sid != null) {
|
||||
sid = sid.replaceAll(SANITIZATION_REGEX, "_");
|
||||
s_logger.warn(String.format("sid [%s] in url does not match stored sid.", sid));
|
||||
} else {
|
||||
s_logger.warn("Null sid in URL.");
|
||||
}
|
||||
|
||||
sendResponse(resp, "failed");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -7201,7 +7201,8 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
|
||||
|
||||
_securityGroupMgr.addInstanceToGroups(vm.getId(), securityGroupIdList);
|
||||
|
||||
s_logger.debug("AssignVM: Basic zone, adding security groups no " + securityGroupIdList.size() + " to " + vm.getInstanceName());
|
||||
int securityIdList = securityGroupIdList != null ? securityGroupIdList.size() : 0;
|
||||
s_logger.debug("AssignVM: Basic zone, adding security groups no " + securityIdList + " to " + vm.getInstanceName());
|
||||
} else {
|
||||
Set<NetworkVO> applicableNetworks = new LinkedHashSet<>();
|
||||
Map<Long, String> requestedIPv4ForNics = new HashMap<>();
|
||||
|
||||
@ -255,7 +255,8 @@ public class OutOfBandManagementServiceImpl extends ManagerBase implements OutOf
|
||||
|
||||
Host host = hostDao.findById(hostId);
|
||||
if (host == null || host.getResourceState() == ResourceState.Degraded) {
|
||||
LOG.debug(String.format("Host [id=%s, state=] was removed or placed in Degraded state by the Admin.", hostId, host.getResourceState()));
|
||||
String state = host != null ? String.valueOf(host.getResourceState()) : null;
|
||||
LOG.debug(String.format("Host [id=%s, state=%s] was removed or placed in Degraded state by the Admin.", hostId, state));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -865,7 +865,7 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
||||
|
||||
String templateUuid = UUID.randomUUID().toString();
|
||||
String templateName = templateUuid + ".vhd";
|
||||
Script command = new Script(createTemplateFromSnapshotXenScript, cmd.getWait() * 1000, s_logger);
|
||||
Script command = new Script(createTemplateFromSnapshotXenScript, cmd.getWait() * 1000L, s_logger);
|
||||
command.add("-p", snapshotPath);
|
||||
command.add("-s", snapshotName);
|
||||
command.add("-n", templateName);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user