Description of problem: version :3.6.7.5-1.el6 ovirt-engine API is not supported to create vm with clustername is not default and templates is not blank. Version-Release number of selected component (if applicable): 3.6.7.5-1.el6 How reproducible: Steps to Reproduce: vm_cluster = api.clusters.get(name="node1") vm_template = api.templates.get(name="Blank") [root@it-ovirtm01-manager scripts]# sh create_vm.sh <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <fault> <reason>Operation Failed</reason> <detail>[Cannot add VM. Physical Memory Guaranteed cannot exceed Memory Size.]</detail> </fault> [root@it-ovirtm01-manager scripts]# python create_vm.py Adding virtual machine 'api_test_vm' failed: status: 400 reason: Bad Request detail: Cannot add VM. Physical Memory Guaranteed cannot exceed Memory Size. [root@it-ovirtm01-manager scripts]# Actual results: Expected results: Additional info:
Can you please share the script create_vm.sh and create_vm.py?
from ovirtsdk.api import API from ovirtsdk.xml import params try: api = API (url="https://ovirtm-bg", username="admin@internal", password="!@#!@#@!", ca_file="ca.crt" ) vm_name = "api_test_vm" vm_memory = 1 vm_cluster = api.clusters.get(name="node1") vm_template = api.templates.get(name="templates") vm_os = params.OperatingSystem(boot=[params.Boot(dev="hd")]) vm_params = params.VM(name="api_test_vm", memory=vm_memory, cluster=vm_cluster, template=vm_template, os=vm_os) try: api.vms.add(vm=vm_params) print "Virtual machine '%s' added." % vm_name except Exception as ex: print "Adding virtual machine '%s' failed: %s" % (vm_name, ex) api.disconnect() except Exception as ex: print "Unexpected error: %s" % ex
You are passing 'vm_memory = 1'. This value is in bytes, so if you want to have VM with one GiB you have to pass 'vm_memory = 1073741824'.
TKS