public void setBroadcastUri(URI broadcastUri) { // only do this if the scheme needs aligning with the broadcastUri if (broadcastUri != null && getBroadcastType() == null) { setBroadcastType(BroadcastDomainType.getSchemeValue(broadcastUri)); } this.broadcastUri = broadcastUri; }
public String getNetworkUuid() { return super.getUuid(); }
public void setNetworkUuid(String uuid) { super.setUuid(uuid); }
@Override public Answer execute(final CheckOnHostCommand command, final LibvirtComputingResource libvirtComputingResource) { final ExecutorService executors = Executors.newSingleThreadExecutor(); final KVMHAMonitor monitor = libvirtComputingResource.getMonitor(); final List<NfsStoragePool> pools = monitor.getStoragePools(); final HostTO host = command.getHost(); final NetworkTO privateNetwork = host.getPrivateNetwork(); final KVMHAChecker ha = new KVMHAChecker(pools, privateNetwork.getIp()); final Future<Boolean> future = executors.submit(ha); try { final Boolean result = future.get(); if (result) { return new Answer(command, false, "Heart is beating..."); } else { return new Answer(command); } } catch (final InterruptedException e) { return new Answer(command, false, "CheckOnHostCommand: can't get status of host: InterruptedException"); } catch (final ExecutionException e) { return new Answer(command, false, "CheckOnHostCommand: can't get status of host: ExecutionException"); } } }
public HostTO(Host vo) { guid = vo.getGuid(); privateNetwork = new NetworkTO(vo.getPrivateIpAddress(), vo.getPrivateNetmask(), vo.getPrivateMacAddress()); if (vo.getPublicIpAddress() != null) { publicNetwork = new NetworkTO(vo.getPublicIpAddress(), vo.getPublicNetmask(), vo.getPublicMacAddress()); } if (vo.getStorageIpAddress() != null) { storageNetwork1 = new NetworkTO(vo.getStorageIpAddress(), vo.getStorageNetmask(), vo.getStorageMacAddress()); } if (vo.getStorageIpAddressDeux() != null) { storageNetwork2 = new NetworkTO(vo.getStorageIpAddressDeux(), vo.getStorageNetmaskDeux(), vo.getStorageMacAddressDeux()); } }
@Override public Answer execute(final CheckVMActivityOnStoragePoolCommand command, final LibvirtComputingResource libvirtComputingResource) { final ExecutorService executors = Executors.newSingleThreadExecutor(); final KVMHAMonitor monitor = libvirtComputingResource.getMonitor(); final StorageFilerTO pool = command.getPool(); if (Storage.StoragePoolType.NetworkFilesystem == pool.getType()){ final NfsStoragePool nfspool = monitor.getStoragePool(pool.getUuid()); final KVMHAVMActivityChecker ha = new KVMHAVMActivityChecker(nfspool, command.getHost().getPrivateNetwork().getIp(), command.getVolumeList(), libvirtComputingResource.getVmActivityCheckPath(), command.getSuspectTimeInSeconds()); final Future<Boolean> future = executors.submit(ha); try { final Boolean result = future.get(); if (result) { return new Answer(command, false, "VMHA disk activity detected ..."); } else { return new Answer(command); } } catch (InterruptedException e) { return new Answer(command, false, "CheckVMActivityOnStoragePoolCommand: can't get status of host: InterruptedException"); } catch (ExecutionException e) { return new Answer(command, false, "CheckVMActivityOnStoragePoolCommand: can't get status of host: ExecutionException"); } } return new Answer(command, false, "Unsupported Storage"); } }