[ovirt-users] How to manage to update the Quota limits parameters (cpu, memory and disk)

Manuel Luis Aznar manuel.luis.aznar at gmail.com
Fri Feb 17 12:21:09 UTC 2017


Hello there,

I want to update the quota limit parameters for vcpu, memory and disk, but
I dont find the way.

I manage to get the actual values but I am unable to manage how to update
this values.

I am doing the following (I ommit the imports and conection stuff):

      system_service = connection.system_service()

      data_centers_service = system_service.data_centers_service()

      data_center = data_centers_service.list(search='name=Prueba2')[0]

      data_center_service = data_centers_service.data_center_service(id=
data_center.id)

      quotas_service = data_center_service.quotas_service()

      quota = quotas_service.list()[0]

      quota_service = quotas_service.quota_service(id=quota.id)

      quota_cluster_limits_service =
quota_service.quota_cluster_limits_service()

      quotaclusterlimit = quota_cluster_limits_service.list()[0]

      quota_storage_limits_service =
quota_service.quota_storage_limits_service()

quotastoragelimit = quota_storage_limits_service.list()[0]

if after that I print the following:
      quotaclusterlimit.memory_limit
      quotaclusterlimit.vcpu_limit
      quotastoragelimit.limit

i see the actual values of the limits, but, I m not able to update that
values (I have been testing on how to do it). It seems that the only method
that let you update anything on a quota is using:

       quota_service.add(quota=...)

I start creating a new quota object with these new limits by doing the
following:

      new_quotastoragelimit = ovirtsdk4.types.QuotaStorageLimit(limit=100)
      new_quotaclusterlimit =
ovirtsdk4.types.QuotaClusterLimit(memory_limit=100,vcpu_limit=10)

      new_quota =
ovirtsdk4.types.Quota(quota_cluster_limits=new_quotaclusterlimit,
quota_storage_limits=new_quotastoragelimit)

      quota_service.update(quota=new_quota)

I have directly tried to edit the printed values directly and then doing
the update but I got nothing (got event in the engine but the limit did not
change)

      quotaclusterlimit.memory_limit =100
      quotaclusterlimit.vcpu_limit = 10
      quotastoragelimit.limit = 100
      quota_service.update(quota=quota) # updating quota with itself

I suppose that there would be a way on how to this, so if you can help, i
will really appreciate you.

Thanks for all in advance to all
Manuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20170217/accfe190/attachment-0001.html>


More information about the Users mailing list