Creating server exceeding personality file size isn't throwing OverLimit exception.

Bug #1023316 reported by meenakshi m
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Medium
Unassigned

Bug Description

Description:

Server is getting created with personality file size exceeding the limit ,
but it has to OverLimit exception.

Expected:
Should raise OverLimit Exception.

Actual:
Server is getting Created.

Steps to be followed:
1. Create a file with an encoded data.
2. Set the limit of "injected_file_content_bytes" to the size of created file minus 1.
3. Check for the Updated Limit value.
4. Try to create a server with personality file created above.

LOG:

Create a file with encoded data and check its size
>>> import os
>>> os.path.getsize('/home/muralik/banner.txt')
141

Set the limit of injected_file_content_bytes to size 140
nova-manage project quota --project=2ade81f157df446b856bdbe38073620a --key injected_file_content_bytes --value 140
2012-07-11 19:25:44 DEBUG nova.utils [req-bcda3941-4f26-42bc-98dc-4e74d5f997b8 None None] backend <module 'nova.db.sqlalchemy.api' from '/opt/stack/nova/nova/db/sqlalchemy/api.pyc'> from (pid=24504) __get_backend /opt/stack/nova/nova/utils.py:484
metadata_items: 128
injected_file_content_bytes: 140
volumes: 10
gigabytes: 1000
ram: 51200
floating_ips: 10
security_group_rules: 20
instances: 10
key_pairs: 100
injected_files: 5
cores: 20
injected_file_path_bytes: 255
security_groups: 10

Create a server with personality file created above
muralik@ubuntu:~$ nova boot --image 9498d38d-cfb1-4818-90e4-70e66d7c75da --flavor 1 --user_data /home/muralik/banner.txt "exceeding_limit"
+-------------------------------------+--------------------------------------+
| Property | Value |
+-------------------------------------+--------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-SRV-ATTR:host | None |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None |
| OS-EXT-SRV-ATTR:instance_name | instance-00000016 |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building |
| accessIPv4 | |
| accessIPv6 | |
| adminPass | 6iKunduU48vD |
| config_drive | |
| created | 2012-07-11T13:57:35Z |
| flavor | m1.tiny |
| hostId | |
| id | 657b4155-f5cb-49ac-b7d0-f99f06f724bc |
| image | cirros-0.3.0-x86_64-uec |
| key_name | |
| metadata | {} |
| name | exceeding_limit |
| progress | 0 |
| status | BUILD |
| tenant_id | 93f94664e0734c479945e43df39d6614 |
| updated | 2012-07-11T13:57:36Z |
| user_id | a0585fd48bee4a728422afd1c4f6bfab |
+-------------------------------------+--------------------------------------+

muralik@ubuntu:~$ nova list
+--------------------------------------+-----------------+--------+-------------------+
| ID | Name | Status | Networks |
+--------------------------------------+-----------------+--------+-------------------+
| 657b4155-f5cb-49ac-b7d0-f99f06f724bc | exceeding_limit | ACTIVE | private=10.0.0.17 |
+--------------------------------------+-----------------+--------+-------------------+

Thierry Carrez (ttx)
Changed in nova:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Eoghan Glynn (eglynn) wrote :

Looks like you're using the wrong option to nova boot, see help:

  --file <dst-path=src-path>
                        Store arbitrary files from <src-path> locally to <dst-
                        path> on the new server. You may store up to 5 files.
  --user_data <user-data>
                        user data file to pass to be exposed by the metadata
                        server.

In order to trigger the injected_file_content_bytes, you need to use the --file option instead of --user-data.

In which case, you should see an expected 413 response such as:

PESP:{'status': '413', 'content-length': '93', 'x-compute-request-id': '...', 'retry-after': '0', 'date': 'Tue, 31 Jul 2012 14:57:12 GMT', 'content-type': 'application/json; charset=UTF-8'} {"overLimit": {"message": "Personality file content too long", "code": 413, "retryAfter": 0}}

Changed in nova:
status: Confirmed → Invalid
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.