<div dir="ltr"><div><div><div><div><div><div><div><div><div>Thanks for your help Ondra,<br><br></div>Now I able to allocate 300MB memory for VM.<br><br></div>But I observe some different behaviour than mention in your mail, let me explain.<br><br></div>Let consider, parameter memory value is M.<br></div>And parameter for guaranteed memory value is G<br><br></div>Case 1> M < G => Fail to create VM got same error.<br></div>Case 2> M = G => VM created successfully.<br></div>Case 3> M > G => VM created successfully.<br><br></div><div>On GUI, in general tab it show guaranteed memory as "Physical Memory Guaranteed" and memory parameter is shown as "Defined Memory".<br></div><div>Meaning of those two parameter look to me, <br>1> guaranteed value mean like as minimum requirement to run VM and <br>2> memory value is like if available would be better.<br><br></div><div>Would you please provide input on same ?<br></div><div><br></div><div><br></div>Thanks,<br></div>~Rohit<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 10, 2017 at 6:50 PM, Ondra Machacek <span dir="ltr"><<a href="mailto:omachace@redhat.com" target="_blank">omachace@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You must make sure you have `memory` attribute higher then `memory_guaranteed`<br>
<br>
For example this will work:<br>
<br>
memory=2*2**30,<br>
memory_policy=types.<wbr>MemoryPolicy(<br>
guaranteed=1*2**30,<br>
),<br>
<br>
and this won't work:<br>
<br>
memory=1*2**30,<br>
memory_policy=types.<wbr>MemoryPolicy(<br>
guaranteed=2*2**30,<br>
),<br>
<br>
Because guaranteed memory must be higher.<br>
<div class="HOEnZb"><div class="h5"><br>
On Tue, Jan 10, 2017 at 2:05 PM, TranceWorldLogic .<br>
<<a href="mailto:tranceworldlogic@gmail.com">tranceworldlogic@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I was also getting same issue.<br>
> And found that it work only for 1024 MB memory size. It may be due to<br>
> "Blank" template value, not sure.<br>
><br>
> Please someone help us to figure out this problem.<br>
><br>
> Thanks,<br>
> ~Rohit<br>
><br>
> On Mon, Jan 9, 2017 at 10:36 PM, Logan Kuhn <<a href="mailto:support@jac-properties.com">support@jac-properties.com</a>><br>
> wrote:<br>
>><br>
>> I'm working on a program that should take a set of variables for the name,<br>
>> ram and disk space as well as how many disks (IE, 3 at 10, 15 and 20GB).<br>
>> Most of that works, but if I try and specify an integer value for memory it<br>
>> will seemingly always fail. I'm using Python 3, code and error are below.<br>
>><br>
>> def create_vm(name, ram, cpu=None):<br>
>> garbled_passwd = 'd3lrazNwa2wjUnI='<br>
>><br>
>> logging.basicConfig(level=<wbr>logging.DEBUG,<br>
>> filename=os.path.join(baseDir, 'list_vms.log'))<br>
>><br>
>> # This example will connect to the server and create a new virtual<br>
>> machine:<br>
>><br>
>> # Create the connection to the server:<br>
>> connection = sdk.Connection(<br>
>> url='<a href="https://ovirt.example.com/ovirt-engine/api" rel="noreferrer" target="_blank">https://ovirt.example.<wbr>com/ovirt-engine/api</a>',<br>
>> username='admin@internal',<br>
>> password=base64.b64decode(<wbr>garbled_passwd).decode('utf-8'<wbr>),<br>
>> ca_file='/etc/pki/tls/certs/<wbr>examplecert.pem',<br>
>> debug=True,<br>
>> log=logging.getLogger(),<br>
>> )<br>
>><br>
>> # Get the reference to the "vms" service:<br>
>> vms_service = connection.system_service().<wbr>vms_service()<br>
>><br>
>> # Use the "add" method to create a new virtual machine:<br>
>> cpu = types.CpuTopology(cores=2, sockets=1)<br>
>><br>
>> vms_service.add(<br>
>> types.Vm(<br>
>> name=name,<br>
>> memory=400,<br>
>> cpu=types.Cpu(topology=cpu),<br>
>> cluster=types.Cluster(<br>
>> name='Default',<br>
>> ),<br>
>> template=types.Template(<br>
>> name='Blank',<br>
>> ),<br>
>> ),<br>
>> )<br>
>><br>
>> # Close the connection to the server:<br>
>> connection.close()<br>
>><br>
>> ovirtsdk4.Error: Fault reason is "Operation Failed". Fault detail is<br>
>> "[Cannot add VM. Physical Memory Guaranteed cannot exceed Memory Size.]".<br>
>> HTTP response code is 400.<br>
>><br>
>> The Template is unmodified from installation time. I know the other<br>
>> settings are right because if I comment out the memory line then it creates<br>
>> a VM with the memory value from the "Blank" template.<br>
>><br>
>> Regards,<br>
>> Logan<br>
>><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>
><br>
><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>
</div></div></blockquote></div><br></div>