trigger next while vm has no vDPA nics during migration
@@ -1699,6 +1699,12 @@ public class KVMHost extends HostBase implements Host {
.eq(VmNicVO_.type, "vDPA")
.list();
List<NicTO> nicTos = VmNicInventory.valueOf(nics).stream().map(this::completeNicInfo).collect(Collectors.toList());
+ List<NicTO> vDPANics = new ArrayList<NicTO>();
+ for (NicTO nicTo : nicTos) {
+ if (nicTo.getType().equals("vDPA")) {
+ vDPANics.add(nicTo);
+ }
+ }
FlowChain chain = FlowChainBuilder.newShareFlowChain();
chain.setName(String.format("migrate-vm-%s-on-kvm-host-%s", vmUuid, self.getUuid()));
@@ -1710,7 +1716,7 @@ public class KVMHost extends HostBase implements Host {
@Override
public void run(final FlowTrigger trigger, Map data) {
- if (nicTos.isEmpty()) {
+ if (vDPANics.isEmpty()) {
trigger.next();
}
GenerateVdpaCmd cmd = new GenerateVdpaCmd();
@@ -1876,7 +1882,7 @@ public class KVMHost extends HostBase implements Host {
@Override
public void run(final FlowTrigger trigger, Map data) {
- if (nicTos.isEmpty()) {
+ if (vDPANics.isEmpty()) {
trigger.next();
}
DeleteVdpaCmd cmd = new DeleteVdpaCmd();
