mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
provider/openstack: Deprecating Instance Volume attribute (#13062)
This commit deprecates the volume attribute in the openstack_compute_instance_v2 resource. It's recommended to either use the block_device attribute or the openstack_compute_volume_attach_v2 resource.
This commit is contained in:
parent
ee0e23b242
commit
de8e2d7f2b
@ -243,8 +243,9 @@ func resourceComputeInstanceV2() *schema.Resource {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
"volume": &schema.Schema{
|
"volume": &schema.Schema{
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
|
Deprecated: "Use block_device or openstack_compute_volume_attach_v2 instead",
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"id": &schema.Schema{
|
"id": &schema.Schema{
|
||||||
|
@ -35,13 +35,13 @@ resource "openstack_compute_instance_v2" "basic" {
|
|||||||
### Instance With Attached Volume
|
### Instance With Attached Volume
|
||||||
|
|
||||||
```
|
```
|
||||||
resource "openstack_blockstorage_volume_v1" "myvol" {
|
resource "openstack_blockstorage_volume_v2" "myvol" {
|
||||||
name = "myvol"
|
name = "myvol"
|
||||||
size = 1
|
size = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "openstack_compute_instance_v2" "volume-attached" {
|
resource "openstack_compute_instance_v2" "myinstance" {
|
||||||
name = "volume-attached"
|
name = "myinstance"
|
||||||
image_id = "ad091b52-742f-469e-8f3c-fd81cadf0743"
|
image_id = "ad091b52-742f-469e-8f3c-fd81cadf0743"
|
||||||
flavor_id = "3"
|
flavor_id = "3"
|
||||||
key_pair = "my_key_pair_name"
|
key_pair = "my_key_pair_name"
|
||||||
@ -50,10 +50,11 @@ resource "openstack_compute_instance_v2" "volume-attached" {
|
|||||||
network {
|
network {
|
||||||
name = "my_network"
|
name = "my_network"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
volume {
|
resource "openstack_compute_volume_attach_v2" "attached" {
|
||||||
volume_id = "${openstack_blockstorage_volume_v1.myvol.id}"
|
compute_id = "${openstack_compute_instance_v2.myinstance.id}"
|
||||||
}
|
volume_id = "${openstack_blockstorage_volume_v2.myvol.id}"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -320,7 +321,7 @@ The following arguments are supported:
|
|||||||
following [reference](http://docs.openstack.org/developer/nova/block_device_mapping.html)
|
following [reference](http://docs.openstack.org/developer/nova/block_device_mapping.html)
|
||||||
for more information.
|
for more information.
|
||||||
|
|
||||||
* `volume` - (Optional) Attach an existing volume to the instance. The volume
|
* `volume` - (Deprecated) Attach an existing volume to the instance. The volume
|
||||||
structure is described below. *Note*: This is no longer the recommended
|
structure is described below. *Note*: This is no longer the recommended
|
||||||
method of attaching a volume to an instance. Please see `block_device`
|
method of attaching a volume to an instance. Please see `block_device`
|
||||||
(above) or the `openstack_compute_volume_attach_v2` and
|
(above) or the `openstack_compute_volume_attach_v2` and
|
||||||
|
Loading…
Reference in New Issue
Block a user