[Expired for OpenStack Compute (nova) because there has been no activity
for 60 days.]

** Changed in: nova
       Status: Incomplete => Expired

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1706310

Title:
  Quota usage is not updated if an instance is deleted while booting

Status in OpenStack Compute (nova):
  Expired

Bug description:
  OpenStack version: Ocata

  Description
  ===========
  If you delete an instance while booting (i.e. vm_state=building, 
task_state=scheduling), such instance is not listed anymore by the "nova list" 
but the quota usage is not updated (i.e. it should be decreased by the flavor 
size).

  Steps to reproduce
  ==================
  1) edit /etc/nova/nova-api.conf

  $ cat /etc/nova/nova-api.conf
  [conductor]
  topic=my_topic

  and restart nova-api service
  # systemctl restart openstack-nova-api.service

  2) check the project usage
  (project_id="01ab8de5387547d093aa8ae6b85bd8b1")

  MariaDB [nova]> select * from quota_usages where 
project_id="01ab8de5387547d093aa8ae6b85bd8b1";
  
+---------------------+---------------------+------------+----+----------------------------------+-----------------+--------+----------+---------------+---------+----------------------------------+
  | created_at          | updated_at          | deleted_at | id | project_id    
                   | resource        | in_use | reserved | until_refresh | 
deleted | user_id                          |
  
+---------------------+---------------------+------------+----+----------------------------------+-----------------+--------+----------+---------------+---------+----------------------------------+
  | 2017-05-23 09:42:02 | 2017-07-25 10:18:22 | NULL       |  1 | 
01ab8de5387547d093aa8ae6b85bd8b1 | instances       |      0 |        0 |        
  NULL |       0 | 4469ff06d1e247e0bbfc23668e92bd66 |
  | 2017-05-23 09:42:02 | 2017-07-25 10:18:22 | NULL       |  2 | 
01ab8de5387547d093aa8ae6b85bd8b1 | ram             |      0 |        0 |        
  NULL |       0 | 4469ff06d1e247e0bbfc23668e92bd66 |
  | 2017-05-23 09:42:02 | 2017-07-25 10:18:22 | NULL       |  3 | 
01ab8de5387547d093aa8ae6b85bd8b1 | cores           |      0 |        0 |        
  NULL |       0 | 4469ff06d1e247e0bbfc23668e92bd66 |
  | 2017-05-23 13:21:26 | 2017-05-23 13:21:26 | NULL       |  4 | 
01ab8de5387547d093aa8ae6b85bd8b1 | security_groups |      0 |        0 |        
     0 |       0 | 4469ff06d1e247e0bbfc23668e92bd66 |
  
+---------------------+---------------------+------------+----+----------------------------------+-----------------+--------+----------+---------------+---------+----------------------------------+
  4 rows in set (0,00 sec)

  3) create a new instance (the task_state will be "scheduling" and
  vm_state = "building")

  $ openstack server create --flavor m1.tiny --image cirros --nic 
net-id=admin_net --security-group default test
  
+-------------------------------------+------------------------------------------------+
  | Field                               | Value                                 
         |
  
+-------------------------------------+------------------------------------------------+
  | OS-DCF:diskConfig                   | MANUAL                                
         |
  | OS-EXT-AZ:availability_zone         |                                       
         |
  | OS-EXT-SRV-ATTR:host                | None                                  
         |
  | OS-EXT-SRV-ATTR:hypervisor_hostname | None                                  
         |
  | OS-EXT-SRV-ATTR:instance_name       |                                       
         |
  | OS-EXT-STS:power_state              | NOSTATE                               
         |
  | OS-EXT-STS:task_state               | scheduling                            
         |
  | OS-EXT-STS:vm_state                 | building                              
         |
  | OS-SRV-USG:launched_at              | None                                  
         |
  | OS-SRV-USG:terminated_at            | None                                  
         |
  | accessIPv4                          |                                       
         |
  | accessIPv6                          |                                       
         |
  | addresses                           |                                       
         |
  | adminPass                           | 4i8zTGZZ3u9w                          
         |
  | config_drive                        |                                       
         |
  | created                             | 2017-07-25T10:18:21Z                  
         |
  | flavor                              | m1.tiny 
(5cdecdda-111d-4659-acc3-506609e5fadc) |
  | hostId                              |                                       
         |
  | id                                  | aab25cc8-9df6-4f3b-9585-3cf099bb1adb  
         |
  | image                               | cirros 
(03d54ef8-f0ac-4ad2-92a0-95835d77d2b5)  |
  | key_name                            | None                                  
         |
  | name                                | test                                  
         |
  | progress                            | 0                                     
         |
  | project_id                          | 01ab8de5387547d093aa8ae6b85bd8b1      
         |
  | properties                          |                                       
         |
  | security_groups                     | name='default'                        
         |
  | status                              | BUILD                                 
         |
  | updated                             | 2017-07-25T10:18:23Z                  
         |
  | user_id                             | 4469ff06d1e247e0bbfc23668e92bd66      
         |
  | volumes_attached                    |                                       
         |
  
+-------------------------------------+------------------------------------------------+

  $ openstack server show aab25cc8-9df6-4f3b-9585-3cf099bb1adb
  
+-------------------------------------+------------------------------------------------+
  | Field                               | Value                                 
         |
  
+-------------------------------------+------------------------------------------------+
  | OS-DCF:diskConfig                   | MANUAL                                
         |
  | OS-EXT-AZ:availability_zone         |                                       
         |
  | OS-EXT-SRV-ATTR:host                | None                                  
         |
  | OS-EXT-SRV-ATTR:hypervisor_hostname | None                                  
         |
  | OS-EXT-SRV-ATTR:instance_name       |                                       
         |
  | OS-EXT-STS:power_state              | NOSTATE                               
         |
  | OS-EXT-STS:task_state               | scheduling                            
         |
  | OS-EXT-STS:vm_state                 | building                              
         |
  | OS-SRV-USG:launched_at              | None                                  
         |
  | OS-SRV-USG:terminated_at            | None                                  
         |
  | accessIPv4                          |                                       
         |
  | accessIPv6                          |                                       
         |
  | addresses                           |                                       
         |
  | config_drive                        |                                       
         |
  | created                             | 2017-07-25T10:18:21Z                  
         |
  | flavor                              | m1.tiny 
(5cdecdda-111d-4659-acc3-506609e5fadc) |
  | hostId                              |                                       
         |
  | id                                  | aab25cc8-9df6-4f3b-9585-3cf099bb1adb  
         |
  | image                               | cirros 
(03d54ef8-f0ac-4ad2-92a0-95835d77d2b5)  |
  | key_name                            | None                                  
         |
  | name                                | test                                  
         |
  | progress                            | 0                                     
         |
  | project_id                          | 01ab8de5387547d093aa8ae6b85bd8b1      
         |
  | properties                          |                                       
         |
  | status                              | BUILD                                 
         |
  | updated                             | 2017-07-25T10:19:25Z                  
         |
  | user_id                             | 4469ff06d1e247e0bbfc23668e92bd66      
         |
  | volumes_attached                    |                                       
         |
  
+-------------------------------------+------------------------------------------------+

  4) check the quota usage for
  project_id="01ab8de5387547d093aa8ae6b85bd8b1"

  MariaDB [nova]> select * from quota_usages where 
project_id="01ab8de5387547d093aa8ae6b85bd8b1";
  
+---------------------+---------------------+------------+----+----------------------------------+-----------------+--------+----------+---------------+---------+----------------------------------+
  | created_at          | updated_at          | deleted_at | id | project_id    
                   | resource        | in_use | reserved | until_refresh | 
deleted | user_id                          |
  
+---------------------+---------------------+------------+----+----------------------------------+-----------------+--------+----------+---------------+---------+----------------------------------+
  | 2017-05-23 09:42:02 | 2017-07-25 10:18:22 | NULL       |  1 | 
01ab8de5387547d093aa8ae6b85bd8b1 | instances       |      1 |        0 |        
  NULL |       0 | 4469ff06d1e247e0bbfc23668e92bd66 |
  | 2017-05-23 09:42:02 | 2017-07-25 10:18:22 | NULL       |  2 | 
01ab8de5387547d093aa8ae6b85bd8b1 | ram             |    512 |        0 |        
  NULL |       0 | 4469ff06d1e247e0bbfc23668e92bd66 |
  | 2017-05-23 09:42:02 | 2017-07-25 10:18:22 | NULL       |  3 | 
01ab8de5387547d093aa8ae6b85bd8b1 | cores           |      1 |        0 |        
  NULL |       0 | 4469ff06d1e247e0bbfc23668e92bd66 |
  | 2017-05-23 13:21:26 | 2017-05-23 13:21:26 | NULL       |  4 | 
01ab8de5387547d093aa8ae6b85bd8b1 | security_groups |      0 |        0 |        
     0 |       0 | 4469ff06d1e247e0bbfc23668e92bd66 |
  
+---------------------+---------------------+------------+----+----------------------------------+-----------------+--------+----------+---------------+---------+----------------------------------+
  4 rows in set (0,00 sec)

  5) delete the instance

  $ openstack server delete aab25cc8-9df6-4f3b-9585-3cf099bb1adb
  $ openstack server show aab25cc8-9df6-4f3b-9585-3cf099bb1adb
  No server with a name or ID of 'aab25cc8-9df6-4f3b-9585-3cf099bb1adb' exists.

  6) check again the quota usage
  MariaDB [nova]> select * from quota_usages where 
project_id="01ab8de5387547d093aa8ae6b85bd8b1";
  
+---------------------+---------------------+------------+----+----------------------------------+-----------------+--------+----------+---------------+---------+----------------------------------+
  | created_at          | updated_at          | deleted_at | id | project_id    
                   | resource        | in_use | reserved | until_refresh | 
deleted | user_id                          |
  
+---------------------+---------------------+------------+----+----------------------------------+-----------------+--------+----------+---------------+---------+----------------------------------+
  | 2017-05-23 09:42:02 | 2017-07-25 10:18:22 | NULL       |  1 | 
01ab8de5387547d093aa8ae6b85bd8b1 | instances       |      1 |        0 |        
  NULL |       0 | 4469ff06d1e247e0bbfc23668e92bd66 |
  | 2017-05-23 09:42:02 | 2017-07-25 10:18:22 | NULL       |  2 | 
01ab8de5387547d093aa8ae6b85bd8b1 | ram             |    512 |        0 |        
  NULL |       0 | 4469ff06d1e247e0bbfc23668e92bd66 |
  | 2017-05-23 09:42:02 | 2017-07-25 10:18:22 | NULL       |  3 | 
01ab8de5387547d093aa8ae6b85bd8b1 | cores           |      1 |        0 |        
  NULL |       0 | 4469ff06d1e247e0bbfc23668e92bd66 |
  | 2017-05-23 13:21:26 | 2017-05-23 13:21:26 | NULL       |  4 | 
01ab8de5387547d093aa8ae6b85bd8b1 | security_groups |      0 |        0 |        
     0 |       0 | 4469ff06d1e247e0bbfc23668e92bd66 |
  
+---------------------+---------------------+------------+----+----------------------------------+-----------------+--------+----------+---------------+---------+----------------------------------+
  4 rows in set (0,00 sec)

  Expected result
  ===============
  The quota usage should be decreased

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1706310/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to