kiranchavala opened a new issue, #11508:
URL: https://github.com/apache/cloudstack/issues/11508

   ### problem
   
   Api: Delete service offering doesn't set the removed date
   
   ### versions
   
   ACS 4.20.1
   
   ### The steps to reproduce the bug
   
   1. Create a service offering 
   
   
https://cloudstack.apache.org/api/apidocs-4.20/apis/createServiceOffering.html
   
   ```
   (admin) 🐱 > create serviceoffering name=ty
   {
     "serviceoffering": {
       "created": "2025-08-25T12:34:51+0000",
       "defaultuse": false,
       "diskofferingdisplaytext": "ty",
       "diskofferingid": "762db6ad-a3c9-4a24-9f49-fffd99463d55",
       "diskofferingname": "ty",
       "diskofferingstrictness": false,
       "displaytext": "ty",
       "dynamicscalingenabled": true,
       "encryptroot": false,
       "gpudisplay": false,
       "hasannotations": false,
       "id": "37351cb6-c5f7-4a32-b235-c0f1f0515421",
       "iscustomized": true,
       "issystem": false,
       "isvolatile": false,
       "limitcpuuse": false,
       "name": "ty",
       "offerha": false,
       "provisioningtype": "thin",
       "rootdisksize": 0,
       "state": "Active",
       "storagetype": "shared"
     }
   }
   ```
   
   Check the database 
   ```
   mysql> select * from service_offering where id=18 \G;
   *************************** 1. row ***************************
                         id: 18
                        cpu: NULL
                      speed: NULL
                   ram_size: NULL
                    nw_rate: NULL
                    mc_rate: NULL
                 ha_enabled: 0
              limit_cpu_use: 0
                   host_tag: NULL
                default_use: 0
                    vm_type: NULL
                   sort_key: 0
                is_volatile: 0
         deployment_planner: NULL
    dynamic_scaling_enabled: 1
                       uuid: 37351cb6-c5f7-4a32-b235-c0f1f0515421
                       name: ty
               display_text: ty
                unique_name: NULL
                 customized: 1
                    created: 2025-08-25 12:34:51
                    removed: NULL
                      state: Active
           disk_offering_id: 23
                 system_use: 0
   disk_offering_strictness: 0
            vgpu_profile_id: NULL
                  gpu_count: NULL
                gpu_display: 0
   1 row in set (0.00 sec)
   ```
   
   
   2. Execute the  api 
   
   
https://cloudstack.apache.org/api/apidocs-4.20/apis/deleteServiceOffering.html
   
   ```
   (admin) 🐱 > delete serviceoffering id=37351cb6-c5f7-4a32-b235-c0f1f0515421
   {
     "success": true
   }
   ```
   
   
    
   3. Check the database table 
   
   
   ```
   mysql> select * from service_offering where id=18 \G;
   *************************** 1. row ***************************
                         id: 18
                        cpu: NULL
                      speed: NULL
                   ram_size: NULL
                    nw_rate: NULL
                    mc_rate: NULL
                 ha_enabled: 0
              limit_cpu_use: 0
                   host_tag: NULL
                default_use: 0
                    vm_type: NULL
                   sort_key: 0
                is_volatile: 0
         deployment_planner: NULL
    dynamic_scaling_enabled: 1
                       uuid: 37351cb6-c5f7-4a32-b235-c0f1f0515421
                       name: ty
               display_text: ty
                unique_name: NULL
                 customized: 1
                    created: 2025-08-25 12:34:51
                    removed: NULL
                      state: Inactive
           disk_offering_id: 23
                 system_use: 0
   disk_offering_strictness: 0
            vgpu_profile_id: NULL
                  gpu_count: NULL
                gpu_display: 0
   1 row in set (0.00 sec)
   
   ```
   
   
   CloudStack is not setting the removed date in the database it only sets the 
offering to Inactive state 
   
   Similar behaviour is observed for the following api
   
   
   https://cloudstack.apache.org/api/apidocs-4.20/apis/createDiskOffering.html
   
   
   
   ```
   mysql> select * from disk_offering where id=26 \G;
   *************************** 1. row ***************************
                            id: 26
                          name: ddsh
                          uuid: 9d227590-5ede-4bc7-b506-6a8ffe0004db
                  display_text: hdahga
                     disk_size: 0
                          tags: NULL
                   recreatable: 0
             use_local_storage: 0
                   unique_name: NULL
                    customized: 0
                       removed: NULL
                       created: 2025-08-25 12:43:31
                      sort_key: 0
              display_offering: 1
               customized_iops: 0
                      min_iops: 0
                      max_iops: 0
               bytes_read_rate: NULL
           bytes_read_rate_max: NULL
    bytes_read_rate_max_length: NULL
              bytes_write_rate: NULL
          bytes_write_rate_max: NULL
   bytes_write_rate_max_length: NULL
                iops_read_rate: NULL
            iops_read_rate_max: NULL
     iops_read_rate_max_length: NULL
               iops_write_rate: NULL
           iops_write_rate_max: NULL
    iops_write_rate_max_length: NULL
                         state: Inactive
                 hv_ss_reserve: NULL
                    cache_mode: none
             provisioning_type: thin
          disk_size_strictness: 0
                  compute_only: 1
                       encrypt: 0
   1 row in set (0.00 sec)
   ```
   
   ### What to do about it?
   
   The delete offering api should update the removed date in the database
   
   
https://cloudstack.apache.org/api/apidocs-4.20/apis/deleteServiceOffering.html
   
   https://cloudstack.apache.org/api/apidocs-4.20/apis/deleteDiskOffering.html
   
   
   we are doing the same operation for 
   
   
https://cloudstack.apache.org/api/apidocs-4.20/apis/deleteNetworkOffering.html
   
   https://cloudstack.apache.org/api/apidocs-4.20/apis/deleteVPCOffering.html
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to