You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cloudstack_service_offering_fixed/_constrained/_unconstrained do not support terraform import #358
The new Plugin Framework resources cloudstack_service_offering_fixed, cloudstack_service_offering_constrained and cloudstack_service_offering_unconstrained do not implement ImportState. Existing service offerings cannot be imported into them. The only importable resource is the deprecated cloudstack_service_offering, which prints a deprecation warning telling users to move to the new resources.
Users cannot follow that guidance for offerings that already exist, so migrating to the new resources means destroying and recreating the offerings.
Steps to reproduce
Use provider cloudstack/cloudstack version 0.7.0, with Terraform 1.16.7.
Create a fixed service offering in CloudStack (for example test-fixed, 1 CPU, 500 MHz, 512 MB).
Error: Resource Import Not Implemented
This resource does not support import. Please contact the provider developer
for additional information.
Expected result
The import succeeds, as it does for cloudstack_service_offering, and terraform plan shows no changes once the config matches the offering.
Analysis
In v0.7.0, cloudstack/resource_cloudstack_service_offering.go (SDKv2) sets Importer: &schema.ResourceImporter{...}. The new resources (service_offering_fixed_resource.go and the _constrained and _unconstrained equivalents) implement Schema, Create, Read, Update, Delete, Configure and Metadata, but not resource.ResourceWithImportState. A minimal fix would be to add ImportState, passing the ID through to id, to all three resources. Read is already implemented and works once the ID is in state.
Workaround
Import with the deprecated cloudstack_service_offering, then retype the state entry to the new resource type by editing the state JSON. The entry must keep only attributes that exist in the new schema. After that, terraform plan shows no changes, with one gotcha: if the offering has dynamic_scaling_enabled = true, it must be set in config, because the new resource defaults it to false and plans a replacement otherwise. This is a fragile workaround and not a real fix.
Hi @weizhouapache
I've implemented ResourceWithImportState for all three service-offering resources and added import-verification steps to their acceptance tests.
The local test suite passes (go test ./cloudstack and go test ./...). I don't currently have access to a configured CloudStack environment, so live acceptance testing remains outstanding.
2. Hi @weizhouapache
I've implemented ResourceWithImportState for all three service-offering resources and added import-verification steps to their acceptance tests.
The local test suite passes (go test ./cloudstack and go test ./...). I don't currently have access to a configured CloudStack environment, so live acceptance testing remains outstanding.
I've opened PR: #359
Feedback and review would be appreciated.
Activity
dheeraj12347 commentedon Oct 28, 2026
Hi @weizhouapache
I've implemented
ResourceWithImportStatefor all three service-offering resources and added import-verification steps to their acceptance tests.The local test suite passes (
go test ./cloudstackandgo test ./...). I don't currently have access to a configured CloudStack environment, so live acceptance testing remains outstanding.I've opened PR: #359
Feedback and review would be appreciated.
weizhouapache commentedon Oct 28, 2026
great, thanks @dheeraj12347