<div dir="ltr"><div>I&#39;m working on a program that should take a set of variables for the name, ram and disk space as well as how many disks (IE, 3 at 10, 15 and 20GB).  Most of that works, but if I try and specify an integer value for memory it will seemingly always fail.  I&#39;m using Python 3, code and error are below.</div><div><br></div><div><div>def create_vm(name, ram, cpu=None):</div><div>        garbled_passwd = &#39;d3lrazNwa2wjUnI=&#39;</div><div><br></div><div>        logging.basicConfig(level=logging.DEBUG, filename=os.path.join(baseDir, &#39;list_vms.log&#39;))</div><div><br></div><div>        # This example will connect to the server and create a new virtual machine:</div><div><br></div><div>        # Create the connection to the server:</div><div>        connection = sdk.Connection(</div><div>            url=&#39;<a href="https://ovirt.example.com/ovirt-engine/api">https://ovirt.example.com/ovirt-engine/api</a>&#39;,</div><div>            username=&#39;admin@internal&#39;,</div><div>            password=base64.b64decode(garbled_passwd).decode(&#39;utf-8&#39;),</div><div>            ca_file=&#39;/etc/pki/tls/certs/examplecert.pem&#39;,</div><div>            debug=True,</div><div>            log=logging.getLogger(),</div><div>        )</div><div><br></div><div>        # Get the reference to the &quot;vms&quot; service:</div><div>        vms_service = connection.system_service().vms_service()</div><div><br></div><div>        # Use the &quot;add&quot; method to create a new virtual machine:</div><div>        cpu = types.CpuTopology(cores=2, sockets=1)</div><div><br></div><div>        vms_service.add(</div><div>            types.Vm(</div><div>                name=name,</div><div>                memory=400,</div><div>                cpu=types.Cpu(topology=cpu),</div><div>                cluster=types.Cluster(</div><div>                    name=&#39;Default&#39;,</div><div>                ),</div><div>                template=types.Template(</div><div>                    name=&#39;Blank&#39;,</div><div>                ),</div><div>            ),</div><div>        )</div><div><br></div><div>        # Close the connection to the server:</div><div>        connection.close()</div><div><br></div><div>ovirtsdk4.Error: Fault reason is &quot;Operation Failed&quot;. Fault detail is &quot;[Cannot add VM. Physical Memory Guaranteed cannot exceed Memory Size.]&quot;. HTTP response code is 400.</div></div><div><br></div><div>The Template is unmodified from installation time.  I know the other settings are right because if I comment out the memory line then it creates a VM with the memory value from the &quot;Blank&quot; template.</div><div><br></div><div><div class="gmail_signature">Regards,<div>Logan</div></div></div>
</div>