Skip to content

The create form accepts zero or negative vCPUs and memory #175

Closed

Description

@catborise

Found in the frontend review of #172.

NewVMForm (built on the CreateInstance model) has no minimum for vcpu, memory or hdd_size. The page posts with formnovalidate, so the browser does not enforce its own min=1 either. A value of 0 or below passes form validation and only fails later in libvirt, inside the job.

The MAC pattern on the page also accepts incomplete addresses such as aa:.

Suggested fix:

  • Validate positive values in the form.
  • Check the MACs there with the existing helper (utils.nic_macs), so the user gets an error on the field instead of a failed job.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions