Quota check for injected_file_contents does not consider base64 encoding

Bug #1225143 reported by Phil Day
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Opinion
Low
Unassigned

Bug Description

File content to be injected as part of instance creation is constrained by the injected_file_content_bytes quota, which is checked by _check_injected_file_quota() in compute/api.py.

However the contents has to be base64 encoded, its encoded in the client and decoded in compute/manager.py. The quota check however is performed against the encoded contents, and so fails when it should pass if the contents is very close to the quota limit

Tags: api quotas
Revision history for this message
Michael Still (mikal) wrote :

I don't think you're correct here. The quota relates to the size of the database column IIRC. That means we can't be lenient here -- we need to enforce a maximum size for the b64 data.

tags: added: api
Changed in nova:
status: New → Incomplete
Revision history for this message
Phil Day (philip-day) wrote :

Hi Michael - User Data is stored in the database - this is about injected files which are not stored in the DB, the content is just passed into the API, across to the manager as part of the create message, and then injected. It's never persisted in Nova itself.

 So I don't think your concern is valid in this case. (That we have sooo many different ways of getting "metadata" into an instance is another story of course)

Michael Still (mikal)
Changed in nova:
status: Incomplete → Triaged
importance: Undecided → Low
wanghong (w-wanghong)
Changed in nova:
assignee: nobody → wanghong (w-wanghong)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/65633

Changed in nova:
status: Triaged → In Progress
wanghong (w-wanghong)
Changed in nova:
assignee: wanghong (w-wanghong) → nobody
Tracy Jones (tjones-i)
Changed in nova:
status: In Progress → Triaged
Joe Gordon (jogo)
tags: added: quotas
Revision history for this message
Joe Gordon (jogo) wrote :

moved to Opinion based on the discussion on the abandoned patch

Changed in nova:
status: Triaged → Opinion
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.