use of org.ovirt.engine.core.common.businessentities.VdsStatic in project ovirt-engine by oVirt.
the class GetErratumByIdForHostQuery method executeQueryCommand.
@Override
protected void executeQueryCommand() {
VdsStatic host = hostStaticDao.get(getParameters().getId());
if (host == null || host.getHostProviderId() == null) {
return;
}
Provider<?> provider = providerDao.get(host.getHostProviderId());
if (provider != null) {
HostProviderProxy proxy = providerProxyFactory.create(provider);
getQueryReturnValue().setReturnValue(proxy.getErratumForHost(host.getHostName(), getParameters().getErratumId()));
}
}
use of org.ovirt.engine.core.common.businessentities.VdsStatic in project ovirt-engine by oVirt.
the class ReportedConfigurationsFillerTest method setUp.
@Before
public void setUp() {
hostId = Guid.newGuid();
clusterId = Guid.newGuid();
VdsStatic vdsStatic = new VdsStatic();
vdsStatic.setId(hostId);
vdsStatic.setClusterId(clusterId);
reportedDnsResolverConfiguration = new DnsResolverConfiguration();
VdsDynamic vdsDynamic = new VdsDynamic();
vdsDynamic.setId(hostId);
vdsDynamic.setReportedDnsResolverConfiguration(reportedDnsResolverConfiguration);
baseNic = createNic("eth0");
vlanNic = createNic("eth0.1");
vlanNic.setBaseInterface(baseNic.getName());
baseNicNetwork = createNetwork("baseNicNetwork");
vlanNetwork = createNetwork("vlanNicNetwork");
vlanNetwork.setVlanId(1);
baseNicNetworkQos = new HostNetworkQos();
baseNicNetworkQos.setId(baseNicNetwork.getQosId());
vlanNetworkQos = new HostNetworkQos();
vlanNetworkQos.setId(vlanNetwork.getQosId());
when(vdsStaticDao.get(hostId)).thenReturn(vdsStatic);
when(vdsDynamicDao.get(hostId)).thenReturn(vdsDynamic);
cluster = new Cluster();
cluster.setCompatibilityVersion(Version.v4_1);
when(clusterDao.get(any())).thenReturn(cluster);
}
use of org.ovirt.engine.core.common.businessentities.VdsStatic in project ovirt-engine by oVirt.
the class GlusterDBUtils method getServer.
/**
* Returns a server from the given cluster, having give host name or IP address.
*
* @return VDS object for the server if found, else null
*/
public VdsStatic getServer(Guid clusterId, String hostnameOrIp) {
// first check for hostname
VdsStatic server = vdsStaticDao.getByHostName(hostnameOrIp);
if (server != null) {
return server.getClusterId().equals(clusterId) ? server : null;
}
// then for ip
List<VdsNetworkInterface> ifaces;
try {
ifaces = interfaceDao.getAllInterfacesWithIpAddress(clusterId, InetAddress.getByName(hostnameOrIp).getHostAddress());
switch(ifaces.size()) {
case 0:
// not found
return null;
case 1:
return vdsStaticDao.get(ifaces.get(0).getVdsId());
default:
// multiple servers in the DB having this ip address!
throw new RuntimeException("There are multiple servers in DB having same IP address " + hostnameOrIp);
}
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
}
use of org.ovirt.engine.core.common.businessentities.VdsStatic in project ovirt-engine by oVirt.
the class HostMaintenanceCallback method getHostName.
private String getHostName(Guid hostId) {
if (hostName == null) {
VdsStatic host = vdsStaticDao.get(hostId);
hostName = host == null ? null : host.getName();
}
return hostName;
}
use of org.ovirt.engine.core.common.businessentities.VdsStatic in project ovirt-engine by oVirt.
the class UpdateVdsCommand method checkKdumpIntegrationStatus.
private void checkKdumpIntegrationStatus() {
VdsStatic vdsSt = getParameters().getVdsStaticData();
if (vdsSt.isPmEnabled() && vdsSt.isPmKdumpDetection()) {
VdsDynamic vdsDyn = vdsDynamicDao.get(vdsSt.getId());
if (vdsDyn != null && vdsDyn.getKdumpStatus() != KdumpStatus.ENABLED) {
AuditLogable logable = new AuditLogableImpl();
logable.setVdsId(vdsSt.getId());
logable.setVdsName(vdsSt.getName());
auditLogDirector.log(logable, AuditLogType.KDUMP_DETECTION_NOT_CONFIGURED_ON_VDS);
}
}
}
Aggregations