Answers: <p>You can use <a href="https://www.terraform.io/cli/state/taint" rel="nofollow noreferrer"><code>--replace</code></a> like this,</p>
  <pre><code>terraform apply --replace=openstack_blockstorage_volume_v3.repo
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2022-06-09T18:55:31.237Z
Answers: 2022-06-09T18:55:31.237Z
Answers: Evan Carroll
Body: <p>Is there a way to <code>terraform apply</code> and recreate the storage volume rather than setting <code>enable_online_resize</code> or running a <code>terraform destroy</code> first?</p>
  <pre><code>openstack_blockstorage_volume_v3.repo: Modifying... [id=87049fb6-1520-41e3-bcde-44f837dd5d1f]
  ╷
  │ Error: Error extending openstack_blockstorage_volume_v3 87049fb6-1520-41e3-bcde-44f837dd5d1f,
  │                                       volume is attached to the instance and
  │                                       resizing online is disabled,
  │                                       see enable_online_resize option
  │ 
  │   with openstack_blockstorage_volume_v3.repo,
  │   on main.tf line 60, in resource &quot;openstack_blockstorage_volume_v3&quot; &quot;repo&quot;:
  │   60: resource &quot;openstack_blockstorage_volume_v3&quot; &quot;repo&quot; {
  </code></pre>
  <p>I realize I'll lose the data on the volume?</p>
  
Tags: <terraform>
Title: Resizing a volume in terraform without enable_online_resize?
UserDisplayName: Evan Carroll
ThreadText: # Resizing a volume in terraform without enable_online_resize?
  
  (Asked by: username_0 on 2022-06-09)
  
  Is there a way to `terraform apply` and recreate the storage volume rather than setting `enable_online_resize` or running a `terraform destroy` first?
  
  ```
  openstack_blockstorage_volume_v3.repo: Modifying... [id=87049fb6-1520-41e3-bcde-44f837dd5d1f]
  ╷
  │ Error: Error extending openstack_blockstorage_volume_v3 87049fb6-1520-41e3-bcde-44f837dd5d1f,
  │                                       volume is attached to the instance and
  │                                       resizing online is disabled,
  │                                       see enable_online_resize option
  │ 
  │   with openstack_blockstorage_volume_v3.repo,
  │   on main.tf line 60, in resource "openstack_blockstorage_volume_v3" "repo":
  │   60: resource "openstack_blockstorage_volume_v3" "repo" {
  
  ```
  
  I realize I'll lose the data on the volume?
  
  **Tags:** terraform
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2022-06-09. Score: 0 | Accepted answer
  
  You can use [`--replace`](https://www.terraform.io/cli/state/taint) like this,
  
  ```
  terraform apply --replace=openstack_blockstorage_volume_v3.repo
  
  ```
  
  
  ---
  
  