We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When performing a terraform destroy on a vcmp guest, an error is thrown if the first virtual disk result doesn't match the one being deleted.
terraform destroy
When looping through the virtual disks, we should move to the next one if the current one isn't the one we're trying to delete, not throw an error.
func deleteVirtualDisk(d *schema.ResourceData, meta interface{}) error { diskName, _ := d.Get("virtual_disk").(string) client := meta.(*bigip.BigIP) virtualDisks, err := client.GetVcmpDisks() if err != nil { return fmt.Errorf("error retrieving vCMP virtual disks: %v", err) } for _, disk := range virtualDisks.Disks { if strings.HasPrefix(disk.Name, diskName) { name := strings.Replace(disk.Name, "/", "~", 1) err := client.DeleteVcmpDisk(name) if err != nil { return fmt.Errorf("error deleting vCMP virtual disk: %v %v", diskName, err) } } else { return fmt.Errorf("cannot find vCMP virtual disk: %v ", diskName) } } return nil }
Steps to reproduce the behavior:
Run a terraform destroy after having created a VCMP guest on a BigIP host with multiple virtual-disks on it.
Delete the virtual disk belonging to the current VCMP guest.
Throws an error if the first virtual disk in the list isn't the one belonging to the current VCMP guest.
Error thrown: Couldn't find disk: %s", disk.Name
Couldn't find disk: %s", disk.Name
The text was updated successfully, but these errors were encountered:
Fixes issue F5Networks#1014
ed017a3
Loop through all virtual disks before failing with "cannot find vCMP virtual disk" error.
Hi @ThomasBartnicki,
In order to review and accept your commit, you need to sign a Customer License Agreement and send it to [email protected]
https://clouddocs.f5.com/products/orchestration/ansible/devel/_downloads/b35c2904c64e94ec52f5e300bfbebfc4/F5-Contributor-License-Agreement.pdf
Sorry, something went wrong.
Hi,
Thanks for reporting. Added to the backlog and internal tracking ID for this request is: INFRAANO-1671.
Successfully merging a pull request may close this issue.
Environment
Summary
When performing a
terraform destroy
on a vcmp guest, an error is thrown if the first virtual disk result doesn't match the one being deleted.When looping through the virtual disks, we should move to the next one if the current one isn't the one we're trying to delete, not throw an error.
Steps To Reproduce
Steps to reproduce the behavior:
Run a
terraform destroy
after having created a VCMP guest on a BigIP host with multiple virtual-disks on it.N/A
N/A
runnning terraform apply/plan
N/A
N/A
Expected Behavior
Delete the virtual disk belonging to the current VCMP guest.
Actual Behavior
Throws an error if the first virtual disk in the list isn't the one belonging to the current VCMP guest.
Error thrown:
Couldn't find disk: %s", disk.Name
The text was updated successfully, but these errors were encountered: