Comment 0 for bug 2020129

Revision history for this message
Amar Rajeev (amar7raj) wrote : Create Reservation with multiple hypervisor properties using API is failing

The lease-create request when given using API call, does not accept multiple properties
(Properties here means hypervisor_properties)
Below is the request given to create lease reservation

{
  "name": "test_lease_1",
  "reservations": [
    {
      "hypervisor_properties": "[
        "and",
        "[\">=\", \"$memory_mb\", \"1024\"]",
        "[\">=\", \"$vcpus\", \"2\"]",
        "[\"=\", \"$hypervisor_type\", \"phyp\"]",
        "[\"=\", \"$hypervisor_hostname\",\"89D0T\"]",
        "[\"=\", \"$hypervisor_version\",\"8\"]"
        ]",
      "max": 1,
      "min": 1,
      "resource_type": "physical:host",
      "resource_properties": ""
    }
  ],
  "start_date": "now",
  "end_date": "2023-05-21 08:00"
}

ERROR: blazar.manager.service Failed to create reservation for a lease. Rollback the lease and associated reservations: sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (1241, 'Operand should contain 1 column(s)')