Skip to content

Commit

Permalink
Disable the creation of VMIs that are incompatible with live migration
Browse files Browse the repository at this point in the history
Signed-off-by: Jed Lejosne <jed@redhat.com>
  • Loading branch information
jean-edouard committed Aug 4, 2020
1 parent dca824c commit 8a5b4ed
Showing 1 changed file with 17 additions and 1 deletion.
Expand Up @@ -925,7 +925,23 @@ func ValidateVirtualMachineInstanceSpec(field *k8sfield.Path, spec *v1.VirtualMa
Field: field.Child("evictionStrategy").String(),
})
}

} else if *spec.EvictionStrategy == v1.EvictionStrategyLiveMigrate {
for _, iface := range spec.Domain.Devices.Interfaces {
if iface.SRIOV != nil {
causes = append(causes, metav1.StatusCause{
Type: metav1.CauseTypeFieldValueInvalid,
Message: "SRIOV interfaces are incompatible with the LiveMigrate eviction strategy",
Field: field.Child("evictionStrategy").String(),
})
}
}
if spec.Domain.Devices.GPUs != nil && len(spec.Domain.Devices.GPUs) > 0 {
causes = append(causes, metav1.StatusCause{
Type: metav1.CauseTypeFieldValueInvalid,
Message: "GPU passthrough is incompatible with the LiveMigrate eviction strategy",
Field: field.Child("evictionStrategy").String(),
})
}
}

if spec.Domain.Devices.GPUs != nil && !config.GPUPassthroughEnabled() {
Expand Down

0 comments on commit 8a5b4ed

Please sign in to comment.