[ovirt-users] Cannot create VM with custom memory amount

Ondra Machacek omachace at redhat.com
Tue Jan 10 13:20:30 UTC 2017


You must make sure you have `memory` attribute higher then `memory_guaranteed`

For example this will work:

 memory=2*2**30,
 memory_policy=types.MemoryPolicy(
     guaranteed=1*2**30,
 ),

and this won't work:

  memory=1*2**30,
  memory_policy=types.MemoryPolicy(
      guaranteed=2*2**30,
  ),

Because guaranteed memory must be higher.

On Tue, Jan 10, 2017 at 2:05 PM, TranceWorldLogic .
<tranceworldlogic at gmail.com> wrote:
> Hi,
>
> I was also getting same issue.
> And found that it work only for 1024 MB memory size. It may be due to
> "Blank" template value, not sure.
>
> Please someone help us to figure out this problem.
>
> Thanks,
> ~Rohit
>
> On Mon, Jan 9, 2017 at 10:36 PM, Logan Kuhn <support at jac-properties.com>
> wrote:
>>
>> 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.
>>
>> def create_vm(name, ram, cpu=None):
>>         garbled_passwd = 'd3lrazNwa2wjUnI='
>>
>>         logging.basicConfig(level=logging.DEBUG,
>> filename=os.path.join(baseDir, 'list_vms.log'))
>>
>>         # This example will connect to the server and create a new virtual
>> machine:
>>
>>         # Create the connection to the server:
>>         connection = sdk.Connection(
>>             url='https://ovirt.example.com/ovirt-engine/api',
>>             username='admin at internal',
>>             password=base64.b64decode(garbled_passwd).decode('utf-8'),
>>             ca_file='/etc/pki/tls/certs/examplecert.pem',
>>             debug=True,
>>             log=logging.getLogger(),
>>         )
>>
>>         # Get the reference to the "vms" service:
>>         vms_service = connection.system_service().vms_service()
>>
>>         # Use the "add" method to create a new virtual machine:
>>         cpu = types.CpuTopology(cores=2, sockets=1)
>>
>>         vms_service.add(
>>             types.Vm(
>>                 name=name,
>>                 memory=400,
>>                 cpu=types.Cpu(topology=cpu),
>>                 cluster=types.Cluster(
>>                     name='Default',
>>                 ),
>>                 template=types.Template(
>>                     name='Blank',
>>                 ),
>>             ),
>>         )
>>
>>         # Close the connection to the server:
>>         connection.close()
>>
>> 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.
>>
>> 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.
>>
>> Regards,
>> Logan
>>
>> _______________________________________________
>> Users mailing list
>> Users at ovirt.org
>> http://lists.ovirt.org/mailman/listinfo/users
>>
>
>
> _______________________________________________
> Users mailing list
> Users at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
>


More information about the Users mailing list