Description of problem: oVIrt machine object is missing some field validations, and the moment we want to add the following validations: - UserDataSecret, CredentialsSecret, OSDisk: must always be set (and can't be empty string). - vmtype must be one of: server, high_performance, desktop - InstanceTypeId can't be set toghter with CPU or MEM. Any bad value should add a proper error message in the logs and move the machine into Failed state. How to test: Try to challenge the logic and create machinesets with invalid fields, the machine should transition into Failed state with a clear error message on the logs
Pushing to next sprint
need to add validation to vmtype- I created machineset with wrong machine type and machine was created with a 'provisioning' state. I expect some warning message.
Provided all my validations steps here: https://github.com/openshift/cluster-api-provider-ovirt/pull/96#issuecomment-811363490
ocp version: 4.8.0-0.nightly-2021-04-09-222447 steps: 1) create machineset with empty osDisk value Actual: machine created successfully without any validation error. machine in status 'running' another issue: 1) create machineset with incorrect value on 'instance_type_id' -need to delete field of memory and cpu 2) run 'oc get machines' - machine created on status 'provisioning' actual: machine created on status 'provisioning' instead of failed with error -E0412 08:25:31.370505 1 controller.go:267] controller-runtime/manager/controller/machine_controller "msg"="Reconciler error" "error"="creating Ovirt instance: Fault reason is \"Operation failed\". Fault detail is \"Invalid UUID string: MemoryMB\". HTTP response code is \"400\". HTTP response message is \"400 Bad Request\"." "name"="primary-m6qrv-worker-24-2mwkk" "namespace"="openshift-machine-api" expected: machine should create with a validation error and status failed
(In reply to michal from comment #4) > ocp version: > 4.8.0-0.nightly-2021-04-09-222447 > > steps: > 1) create machineset with empty osDisk value > Actual: > machine created successfully without any validation error. machine in status > 'running' > > > another issue: > 1) create machineset with incorrect value on 'instance_type_id' -need to > delete field of memory and cpu > 2) run 'oc get machines' - machine created on status 'provisioning' > actual: > machine created on status 'provisioning' instead of failed > with error -E0412 08:25:31.370505 1 controller.go:267] > controller-runtime/manager/controller/machine_controller "msg"="Reconciler > error" "error"="creating Ovirt instance: Fault reason is \"Operation > failed\". Fault detail is \"Invalid UUID string: MemoryMB\". HTTP response > code is \"400\". HTTP response message is \"400 Bad Request\"." > "name"="primary-m6qrv-worker-24-2mwkk" "namespace"="openshift-machine-api" > > expected: > machine should create with a validation error and status failed Hi Michal, I have sent you an invite (for tomorrow) so we can look together to your env and make sure we are using the right image. Also, could you please share the machineset that you used? Feel free to re-schedule the meeting invite. Thanks!
machineset: apiVersion: machine.openshift.io/v1beta1 kind: MachineSet metadata: name: primary-m6qrv-worker-33 labels: machine.openshift.io/cluster-api-cluster: primary-m6qrv machine.openshift.io/cluster-api-machine-role: worker-33 machine.openshift.io/cluster-api-machine-type: worker-33 spec: replicas: 1 selector: matchLabels: machine.openshift.io/cluster-api-cluster: primary-m6qrv machine.openshift.io/cluster-api-machineset: primary-m6qrv-worker-33 template: metadata: labels: machine.openshift.io/cluster-api-cluster: primary-m6qrv machine.openshift.io/cluster-api-machine-role: worker-33 machine.openshift.io/cluster-api-machine-type: worker-33 machine.openshift.io/cluster-api-machineset: primary-m6qrv-worker-33 spec: providerSpec: value: affinity_groups_names: - test1 apiVersion: ovirtproviderconfig.machine.openshift.io/v1beta1 cluster_id: 502babf8-9c05-4738-b5c9-2ac8c33a9648 credentialsSecret: name: ovirt-credentials kind: OvirtMachineProviderSpec os_disk: size_gb: 120 template_name: primary-m6qrv-rhcos instance_type_id: CPU type: server userDataSecret: name: worker-user-data
after talking with Douglas, we decide to separate those bugs into 2 different bugs: https://bugzilla.redhat.com/show_bug.cgi?id=1949231 https://bugzilla.redhat.com/show_bug.cgi?id=1949235 I close this bug because all other scenarios verified and works good
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2021:2438