completion.success(); } else { ErrorCode errorCode = operr("unable to do vm sync on host[uuid:%s, ip:%s] because %s", host.getUuid(), host.getManagementIp(), ret.getError()); completion.fail(errorCode);
@Override public void run(MessageReply reply) { if (!reply.isSuccess()) { complete.fail(reply.getError()); return; } CreateVritualRouterBootstrapIsoRsp rsp = ((KVMHostAsyncHttpCallReply)reply).toResponse(CreateVritualRouterBootstrapIsoRsp.class); if (!rsp.isSuccess()) { ErrorCode err = operr("failed to create VirtualRouterBootstrapIso[%s] on kvm host[uuid:%s, ip:%s] for virtual router[uuid:%s], because %s", iso.getIsoPath(), vrSpec.getDestHost().getUuid(), vrSpec.getDestHost().getManagementIp(), iso.getVirtualRouterUuid(), rsp.getError()); complete.fail(err); return; } complete.success(); } });
private MigrateStruct buildMigrateStuct(final MigrateVmOnHypervisorMsg msg){ MigrateStruct s = new MigrateStruct(); s.vmUuid = msg.getVmInventory().getUuid(); s.srcHostUuid = msg.getSrcHostUuid(); s.dstHostUuid = msg.getDestHostInventory().getUuid(); s.storageMigrationPolicy = msg.getStorageMigrationPolicy(); s.migrateFromDestition = msg.isMigrateFromDestination(); MigrateNetworkExtensionPoint.MigrateInfo migrateIpInfo = null; for (MigrateNetworkExtensionPoint ext: pluginRgty.getExtensionList(MigrateNetworkExtensionPoint.class)) { MigrateNetworkExtensionPoint.MigrateInfo r = ext.getMigrationAddressForVM(s.srcHostUuid, s.dstHostUuid); if (r == null) { continue; } migrateIpInfo = r; } s.dstHostMnIp = msg.getDestHostInventory().getManagementIp(); s.dstHostMigrateIp = migrateIpInfo == null ? s.dstHostMnIp : migrateIpInfo.dstMigrationAddress; s.srcHostMnIp = Q.New(HostVO.class).eq(HostVO_.uuid, msg.getSrcHostUuid()).select(HostVO_.managementIp).findValue(); s.srcHostMigrateIp = migrateIpInfo == null ? s.srcHostMnIp : migrateIpInfo.srcMigrationAddress; return s; }