<div dir="ltr"><div><div><div><div><div>Hi,<br><br></div>I was also getting same issue.<br></div>And found that it work only for 1024 MB memory size. It may be due to "Blank" template value, not sure.<br><br></div>Please someone help us to figure out this problem.<br><br></div>Thanks,<br></div>~Rohit<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 9, 2017 at 10:36 PM, Logan Kuhn <span dir="ltr"><<a href="mailto:support@jac-properties.com" target="_blank">support@jac-properties.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-size:12.8px">I'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'm using Python 3, code and error are below.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div>def create_vm(name, ram, cpu=None):</div><div> garbled_passwd = 'd3lrazNwa2wjUnI='</div><div><br></div><div> logging.basicConfig(level=logg<wbr>ing.DEBUG, filename=os.path.join(baseDir, 'list_vms.log'))</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='<a href="https://ovirt.example.com/ovirt-engine/api" target="_blank">https://ovirt.example.com<wbr>/ovirt-engine/api</a>',</div><div> username='admin@internal',</div><div> password=base64.b64decode(garb<wbr>led_passwd).decode('utf-8'),</div><div> ca_file='/etc/pki/tls/certs/ex<wbr>amplecert.pem',</div><div> debug=True,</div><div> log=logging.getLogger(),</div><div> )</div><div><br></div><div> # Get the reference to the "vms" service:</div><div> vms_service = connection.system_service().vm<wbr>s_service()</div><div><br></div><div> # Use the "add" 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='Default',</div><div> ),</div><div> template=types.Template(</div><div> name='Blank',</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 "Operation Failed". Fault detail is "[Cannot add VM. Physical Memory Guaranteed cannot exceed Memory Size.]". HTTP response code is 400.</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">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 "Blank" template.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div class="m_3200326062491466455gmail-m_-2832130594311703272gmail_signature">Regards,<div>Logan</div></div></div>
</div>
<br>______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@ovirt.org">Users@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/<wbr>mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>