Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,15 @@ public String call(HostUsedCpuMem arg) {
}
});

hostUuids.stream().filter(huuid -> !hostHasVms.contains(huuid)).forEach(huuid -> {
for (String huuid : hostUuids) {
if (hostHasVms.contains(huuid)) {
continue;
}

HostUsedCpuMem s = new HostUsedCpuMem();
s.hostUuid = huuid;
hostUsedCpuMemList.add(s);
});
}

for (final HostUsedCpuMem s : hostUsedCpuMemList) {
new HostCapacityUpdater(s.hostUuid).run(new HostCapacityUpdaterRunnable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.zstack.header.host.HostVO;
import org.zstack.header.image.ImageConstant.ImageMediaType;
import org.zstack.header.image.ImageInventory;
import org.zstack.header.message.APIMessage;
import org.zstack.header.message.MessageReply;
import org.zstack.header.network.l3.L3NetworkInventory;
import org.zstack.header.storage.primary.PrimaryStorageClusterRefVO;
Expand Down Expand Up @@ -95,6 +96,9 @@ public String call(L3NetworkInventory arg) {
}));
msg.setImage(image);
msg.setVmOperation(spec.getCurrentVmOperation().toString());
if (spec.getMessage() instanceof APIMessage && ((APIMessage) spec.getMessage()).getSystemTags() != null) {
msg.setSystemTags(new ArrayList<>(((APIMessage) spec.getMessage()).getSystemTags()));
}

if (spec.getVmInventory().getZoneUuid() != null) {
msg.setZoneUuid(spec.getVmInventory().getZoneUuid());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.zstack.resourceconfig.ResourceConfigFacade;

import java.util.Map;
import java.util.concurrent.TimeUnit;

public class KVMHostCapacityExtension implements KVMHostConnectExtensionPoint, HostConnectionReestablishExtensionPoint {

Expand All @@ -31,6 +32,7 @@ public class KVMHostCapacityExtension implements KVMHostConnectExtensionPoint, H
public void reportCapacity(HostInventory host, Completion completion) {
CheckHostCapacityMsg msg = new CheckHostCapacityMsg();
msg.setHostUuid(host.getUuid());
msg.setTimeout(TimeUnit.MINUTES.toMillis(30));
bus.makeTargetServiceIdByResourceUuid(msg, HostConstant.SERVICE_ID, host.getUuid());
bus.send(msg, new CloudBusCallBack(completion) {
@Override
Expand Down