Skip to content

Commit 48c7b09

Browse files
committed
[BugFix: ZSTACK-25881] use vm hypervisorType if no related host
1 parent 93e6c4c commit 48c7b09

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

compute/src/main/java/org/zstack/compute/vm/VmAllocateNicFlow.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ public void run(MessageReply reply) {
126126
nic.setVmInstanceUuid(spec.getVmInventory().getUuid());
127127
nic.setL3NetworkUuid(areply.getIpInventory().getL3NetworkUuid());
128128
nic.setMac(mac);
129-
nic.setHypervisorType(spec.getDestHost().getHypervisorType());
129+
nic.setHypervisorType(spec.getDestHost() == null ?
130+
spec.getVmInventory().getHypervisorType() : spec.getDestHost().getHypervisorType());
130131
if (mo.checkDuplicateMac(nic.getHypervisorType(), nic.getMac())) {
131132
trigger.fail(operr("Duplicate mac address [%s]", nic.getMac()));
132133
return;

0 commit comments

Comments
 (0)