Skip to content
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

openstack: Instance resize doesn't work if flavor_name is changed #5780

Closed
toddnni opened this issue Mar 22, 2016 · 3 comments · Fixed by #6020
Closed

openstack: Instance resize doesn't work if flavor_name is changed #5780

toddnni opened this issue Mar 22, 2016 · 3 comments · Fixed by #6020
Labels

Comments

@toddnni
Copy link

toddnni commented Mar 22, 2016

Instance resizing doesn't work if flavor_name is changed. However, resize does work if flavor_id is changed.

The error message received from API is

{"badRequest": {"message": "Resize requires a flavor change.", "code": 400}}

To my understanding it doesn't work, because in resource_openstack_compute_instance_v2.go the update function uses getFlavorID() to get the a new flavor ID when either flavor_id or flavor_name is changed, and the function doesn't query OpenStack for a new flavor ID as the old value is already defined.

Maybe we should

  • reverse the order of flavorId != "" and flavorName != "" checks in getFlavorID() so that name change will be reflected
  • or add a parameter to getFlavorID to signal that a parameter changed and it should check for a new ID using the new name
@toddnni toddnni changed the title openstack: Instance resize doesn't work if flavor_name if changed openstack: Instance resize doesn't work if flavor_name is changed Mar 22, 2016
@jtopjian
Copy link
Contributor

Good catch 😄

jtopjian added a commit to jtopjian/terraform that referenced this issue Apr 5, 2016
Previously, resizing would only work if the flavor_id changed and
would create an error if the flavor_name changes. This commit fixes
this behavior.

It also quickly refactors the getFlavorID function to use
Gophercloud's IDFromName function. getFlavorID was the basis of
IDFromName so the exact same code is used.

Fixes hashicorp#5780
@jtopjian
Copy link
Contributor

jtopjian commented Apr 5, 2016

@toddnni I've created #6020 which should fix this. would you be able to compile from source with this patch and give it a test?

chrislovecnm pushed a commit to chrislovecnm/terraform that referenced this issue Apr 16, 2016
Previously, resizing would only work if the flavor_id changed and
would create an error if the flavor_name changes. This commit fixes
this behavior.

It also quickly refactors the getFlavorID function to use
Gophercloud's IDFromName function. getFlavorID was the basis of
IDFromName so the exact same code is used.

Fixes hashicorp#5780
@ghost
Copy link

ghost commented Apr 26, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants