-
Notifications
You must be signed in to change notification settings - Fork 53
Service offering resource update #252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Service offering resource update #252
Conversation
- Add service_offering_details attribute to cloudstack_service_offering resource - Support for GPU configuration with pciDevice and vgpuType parameters - Include comprehensive test coverage and documentation - Add practical examples for GPU service offerings - Addresses issue apache#246
- Update service offering documentation with GPU examples - Add service_offering_details parameter documentation - Update CHANGELOG with new feature entry - Include practical examples for GPU configuration
- Fix code formatting to comply with Go standards - Align map fields and remove trailing whitespace - Required for CI/CD pipeline to pass
add missing cpu_speed
… in service offering
…ent updates after creation
…ive tests for offering types
…d enhanced parameter descriptions
…rom version control
|
@jeanvetorello There was already work done for service offerings around fixed, constrained and unconstrained. Please see the following for discussions around this. @poddm can you review this and give your input on this as your commit a while back took a different aproach and I know we had this discussion about this before. (see links above) @DaanHoogland Also, what is your opinion on this as we need to pick a path and stick to it. We shouldn't have multiple resource files out there for the same thing We need to make sure we are using the most recent framework/sdk as well. This is what was decided back then on method to split up the resources
|
| // | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
| // |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license needs to be there
| !command/test-fixtures/**/.terraform/ | ||
| .terraform.lock.hcl | ||
| provider.tf | ||
| examples/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| examples/ | |
| examples/ | |
@CodeBleu , I completely agree with the blanket statement, but am sure I am missing some context. on first sight I thought you were talking about production code vs test code, but I see no issue there. Can you explain? |
@DaanHoogland There are both |
|
@CodeBleu, I think you're right. We should deprecated this resource. I can open a PR if thats whats decided. |
makes sense, @CodeBleu .
thanks @poddm . it makes no sense to maintain two SDKs for the same API. Will we then defer merging this? or is this a parallel effort? |
|
I need to remove old duplicate service offering files to pass all tests. Should I proceed? |


Overview
This PR completely updates the
cloudstack_service_offeringresource to support CloudStack API version 4.21, achieving 100% SDK coverage with all 54 parameters fromCreateServiceOfferingParamsfully implemented.Motivation
I needed to update the Service Offering API to the latest CloudStack version (4.21) to support modern features like GPU configuration, advanced IOPS settings, and dynamic scaling. The existing implementation was missing critical parameters and had several drift issues.
What's New
1. Complete API v4.21 Coverage (54/54 Parameters)
All parameters from CloudStack Go SDK v2
CreateServiceOfferingParamsare now implemented:CPU & Memory:
cpu_number,cpu_speed,memorycustomized,min_cpu_number,max_cpu_numbermin_memory,max_memoryGPU Support (NEW):
gpu_card- GPU card name (maps togpucardid)gpu_type- vGPU profile UUID (maps tovgpuprofileid)gpu_count- Number of GPUsStorage:
storage_type,storage_tags,host_tagsroot_disk_size,encrypt_rootprovisioning_type,cache_modeIOPS & Bandwidth (12 parameters):
bytes_read_rate,bytes_write_ratebytes_read_rate_max,bytes_write_rate_maxbytes_read_rate_max_length,bytes_write_rate_max_lengthiops_read_rate,iops_write_rateiops_read_rate_max,iops_write_rate_maxiops_read_rate_max_length,iops_write_rate_max_lengthPerformance:
disk_iops_min,disk_iops_maxhypervisor_snapshot_reserveoffer_ha,limit_cpu_usedynamic_scaling_enabledcustomized_iopsSystem & Domain:
is_system,system_vm_typezone_id,domain_idis_volatile,deployment_plannerAdvanced:
service_offering_details(map for custom settings)2. Bug Fixes
Fixed
service_offering_detailsDriftExternal:key,External:value,purge.db.entities) causing state driftFixed
customizedParameter Logiccpu_number+memoryprovided →customized = false(Fixed Offering)customized = true+ min/max → Custom Constrainedcustomized = true+ no limits → Custom UnconstrainedIdentified ForceNew Parameters (47 of 54)
ForceNew: trueto 47 parameters based on CloudStack API limitationsdisplay_text,host_tags, andstorage_tagscan be updated in-place3. Comprehensive Testing
Added 4 new tests covering all CloudStack UI offering types:
TestAccServiceOfferingTypeFixed- Fixed CPU/memoryTestAccServiceOfferingTypeCustomConstrained- Customizable with limitsTestAccServiceOfferingTypeCustomUnconstrained- Fully customizableTestAccServiceOfferingAllUITypes- All types togetherTotal: 17 tests (13 existing + 4 new)
4. Complete Documentation
Created comprehensive documentation in
website/docs/r/service_offering.html.markdown: