Last active
March 22, 2016 10:33
-
-
Save lvjp/28fe09f76d5219fc5a17 to your computer and use it in GitHub Desktop.
Terraform issue#5728
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
me@home:/tmp/tmp.mea1aiYlBW0$ terraform plan | |
Refreshing Terraform state prior to plan... | |
The Terraform execution plan has been generated and is shown below. | |
Resources are shown in alphabetical order for quick scanning. Green resources | |
will be created (or destroyed and then created if an existing resource | |
exists), yellow resources are being changed in-place, and red resources | |
will be destroyed. | |
Note: You didn't specify an "-out" parameter to save this plan, so when | |
"apply" is called, Terraform can't guarantee this is what will execute. | |
+ docker_container.dummy_container | |
bridge: "" => "<computed>" | |
command.#: "" => "1" | |
command.0: "" => "365d" | |
entrypoint.#: "" => "1" | |
entrypoint.0: "" => "/bin/sleep" | |
gateway: "" => "<computed>" | |
image: "" => "${docker_image.dummy_image.latest}" | |
ip_address: "" => "<computed>" | |
ip_prefix_length: "" => "<computed>" | |
log_driver: "" => "json-file" | |
must_run: "" => "1" | |
name: "" => "dummy" | |
restart: "" => "no" | |
volumes.#: "" => "1" | |
volumes.400160962.container_path: "" => "/tmp/dummy" | |
volumes.400160962.from_container: "" => "" | |
volumes.400160962.host_path: "" => "" | |
volumes.400160962.read_only: "" => "" | |
volumes.400160962.volume_name: "" => "dummy-volume" | |
+ docker_image.dummy_image | |
latest: "" => "<computed>" | |
name: "" => "busybox:latest" | |
+ docker_volume.dummy_volume | |
driver: "" => "<computed>" | |
mountpoint: "" => "<computed>" | |
name: "" => "dummy-volume" | |
Plan: 3 to add, 0 to change, 0 to destroy. | |
me@home:/tmp/tmp.mea1aiYlBW0$ terraform apply | |
docker_image.dummy_image: Creating... | |
latest: "" => "<computed>" | |
name: "" => "busybox:latest" | |
docker_volume.dummy_volume: Creating... | |
driver: "" => "<computed>" | |
mountpoint: "" => "<computed>" | |
name: "" => "dummy-volume" | |
docker_volume.dummy_volume: Creation complete | |
docker_image.dummy_image: Creation complete | |
docker_container.dummy_container: Creating... | |
bridge: "" => "<computed>" | |
command.#: "" => "1" | |
command.0: "" => "365d" | |
entrypoint.#: "" => "1" | |
entrypoint.0: "" => "/bin/sleep" | |
gateway: "" => "<computed>" | |
image: "" => "sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149eb" | |
ip_address: "" => "<computed>" | |
ip_prefix_length: "" => "<computed>" | |
log_driver: "" => "json-file" | |
must_run: "" => "1" | |
name: "" => "dummy" | |
restart: "" => "no" | |
volumes.#: "" => "1" | |
volumes.400160962.container_path: "" => "/tmp/dummy" | |
volumes.400160962.from_container: "" => "" | |
volumes.400160962.host_path: "" => "" | |
volumes.400160962.read_only: "" => "" | |
volumes.400160962.volume_name: "" => "dummy-volume" | |
docker_container.dummy_container: Creation complete | |
Apply complete! Resources: 3 added, 0 changed, 0 destroyed. | |
The state of your infrastructure has been saved to the path | |
below. This state is required to modify and destroy your | |
infrastructure, so keep it safe. To inspect the complete state | |
use the `terraform show` command. | |
State path: terraform.tfstate | |
me@home:/tmp/tmp.mea1aiYlBW0$ terraform show | |
docker_container.dummy_container: | |
id = faaf65dbd80ef443c83197da86e99c4f722805f26dd86b5d4f308d75d6327532 | |
bridge = | |
command.# = 1 | |
command.0 = 365d | |
entrypoint.# = 1 | |
entrypoint.0 = /bin/sleep | |
gateway = 172.17.0.1 | |
image = sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149eb | |
ip_address = 172.17.0.6 | |
ip_prefix_length = 16 | |
log_driver = json-file | |
must_run = true | |
name = dummy | |
restart = no | |
volumes.# = 1 | |
volumes.400160962.container_path = /tmp/dummy | |
volumes.400160962.from_container = | |
volumes.400160962.host_path = | |
volumes.400160962.read_only = false | |
volumes.400160962.volume_name = dummy-volume | |
docker_image.dummy_image: | |
id = sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149ebbusybox:latest | |
latest = sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149eb | |
name = busybox:latest | |
docker_volume.dummy_volume: | |
id = dummy-volume | |
driver = local | |
mountpoint = /var/lib/docker/volumes/dummy-volume/_data | |
name = dummy-volume | |
me@home:/tmp/tmp.mea1aiYlBW0$ cat terraform.tfstate | |
# see terraform.v1.tfstate | |
me@home:/tmp/tmp.mea1aiYlBW0$ terraform taint docker_volume.dummy_volume | |
The resource docker_volume.dummy_volume in the module root has been marked as tainted! | |
me@home:/tmp/tmp.mea1aiYlBW0$ cat terraform.tfstate | |
# see terraform.v2.tfstate | |
me@home:/tmp/tmp.mea1aiYlBW0$ terraform plan | |
Refreshing Terraform state prior to plan... | |
docker_volume.dummy_volume: Refreshing state... (ID: dummy-volume) | |
docker_image.dummy_image: Refreshing state... (ID: sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149ebbusybox:latest) | |
docker_container.dummy_container: Refreshing state... (ID: faaf65dbd80ef443c83197da86e99c4f722805f26dd86b5d4f308d75d6327532) | |
The Terraform execution plan has been generated and is shown below. | |
Resources are shown in alphabetical order for quick scanning. Green resources | |
will be created (or destroyed and then created if an existing resource | |
exists), yellow resources are being changed in-place, and red resources | |
will be destroyed. | |
Note: You didn't specify an "-out" parameter to save this plan, so when | |
"apply" is called, Terraform can't guarantee this is what will execute. | |
-/+ docker_volume.dummy_volume | |
driver: "" => "<computed>" | |
mountpoint: "" => "<computed>" | |
name: "" => "dummy-volume" | |
Plan: 1 to add, 0 to change, 0 to destroy. | |
me@home:/tmp/tmp.mea1aiYlBW0$ terraform apply | |
docker_image.dummy_image: Refreshing state... (ID: sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149ebbusybox:latest) | |
docker_volume.dummy_volume: Refreshing state... (ID: dummy-volume) | |
docker_container.dummy_container: Refreshing state... (ID: faaf65dbd80ef443c83197da86e99c4f722805f26dd86b5d4f308d75d6327532) | |
docker_volume.dummy_volume: Destroying... | |
Error applying plan: | |
1 error(s) occurred: | |
* Error deleting volume dummy-volume: volume in use and cannot be removed | |
Terraform does not automatically rollback in the face of errors. | |
Instead, your Terraform state file has been partially updated with | |
any resources that successfully completed. Please address the error | |
above and apply again to incrementally change your infrastructure. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "docker" { | |
host = "unix:///var/run/docker.sock" | |
} | |
resource "docker_container" "dummy_container" { | |
name = "dummy" | |
image = "${docker_image.dummy_image.latest}" | |
must_run = "true" | |
entrypoint = [ "/bin/sleep" ] | |
command = [ "365d" ] | |
volumes = { | |
volume_name = "${docker_volume.dummy_volume.name}" | |
container_path = "/tmp/dummy" | |
} | |
} | |
resource "docker_image" "dummy_image" { | |
name = "busybox:latest" | |
} | |
resource "docker_volume" "dummy_volume" { | |
name = "dummy-volume" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
digraph { | |
compound = "true" | |
newrank = "true" | |
subgraph "root" { | |
"[root] docker_container.dummy_container" [label = "docker_container.dummy_container", shape = "box"] | |
"[root] docker_image.dummy_image" [label = "docker_image.dummy_image", shape = "box"] | |
"[root] docker_volume.dummy_volume" [label = "docker_volume.dummy_volume", shape = "box"] | |
"[root] provider.docker" [label = "provider.docker", shape = "diamond"] | |
"[root] docker_container.dummy_container" -> "[root] docker_image.dummy_image" | |
"[root] docker_container.dummy_container" -> "[root] docker_volume.dummy_volume" | |
"[root] docker_image.dummy_image" -> "[root] provider.docker" | |
"[root] docker_volume.dummy_volume" -> "[root] provider.docker" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": 1, | |
"serial": 1, | |
"modules": [ | |
{ | |
"path": [ | |
"root" | |
], | |
"outputs": {}, | |
"resources": { | |
"docker_container.dummy_container": { | |
"type": "docker_container", | |
"depends_on": [ | |
"docker_image.dummy_image", | |
"docker_volume.dummy_volume" | |
], | |
"primary": { | |
"id": "faaf65dbd80ef443c83197da86e99c4f722805f26dd86b5d4f308d75d6327532", | |
"attributes": { | |
"bridge": "", | |
"command.#": "1", | |
"command.0": "365d", | |
"entrypoint.#": "1", | |
"entrypoint.0": "/bin/sleep", | |
"gateway": "172.17.0.1", | |
"id": "faaf65dbd80ef443c83197da86e99c4f722805f26dd86b5d4f308d75d6327532", | |
"image": "sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149eb", | |
"ip_address": "172.17.0.6", | |
"ip_prefix_length": "16", | |
"log_driver": "json-file", | |
"must_run": "true", | |
"name": "dummy", | |
"restart": "no", | |
"volumes.#": "1", | |
"volumes.400160962.container_path": "/tmp/dummy", | |
"volumes.400160962.from_container": "", | |
"volumes.400160962.host_path": "", | |
"volumes.400160962.read_only": "false", | |
"volumes.400160962.volume_name": "dummy-volume" | |
} | |
} | |
}, | |
"docker_image.dummy_image": { | |
"type": "docker_image", | |
"primary": { | |
"id": "sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149ebbusybox:latest", | |
"attributes": { | |
"id": "sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149ebbusybox:latest", | |
"latest": "sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149eb", | |
"name": "busybox:latest" | |
} | |
} | |
}, | |
"docker_volume.dummy_volume": { | |
"type": "docker_volume", | |
"primary": { | |
"id": "dummy-volume", | |
"attributes": { | |
"driver": "local", | |
"id": "dummy-volume", | |
"mountpoint": "/var/lib/docker/volumes/dummy-volume/_data", | |
"name": "dummy-volume" | |
} | |
} | |
} | |
} | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": 1, | |
"serial": 2, | |
"modules": [ | |
{ | |
"path": [ | |
"root" | |
], | |
"outputs": {}, | |
"resources": { | |
"docker_container.dummy_container": { | |
"type": "docker_container", | |
"depends_on": [ | |
"docker_image.dummy_image", | |
"docker_volume.dummy_volume" | |
], | |
"primary": { | |
"id": "faaf65dbd80ef443c83197da86e99c4f722805f26dd86b5d4f308d75d6327532", | |
"attributes": { | |
"bridge": "", | |
"command.#": "1", | |
"command.0": "365d", | |
"entrypoint.#": "1", | |
"entrypoint.0": "/bin/sleep", | |
"gateway": "172.17.0.1", | |
"id": "faaf65dbd80ef443c83197da86e99c4f722805f26dd86b5d4f308d75d6327532", | |
"image": "sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149eb", | |
"ip_address": "172.17.0.6", | |
"ip_prefix_length": "16", | |
"log_driver": "json-file", | |
"must_run": "true", | |
"name": "dummy", | |
"restart": "no", | |
"volumes.#": "1", | |
"volumes.400160962.container_path": "/tmp/dummy", | |
"volumes.400160962.from_container": "", | |
"volumes.400160962.host_path": "", | |
"volumes.400160962.read_only": "false", | |
"volumes.400160962.volume_name": "dummy-volume" | |
} | |
} | |
}, | |
"docker_image.dummy_image": { | |
"type": "docker_image", | |
"primary": { | |
"id": "sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149ebbusybox:latest", | |
"attributes": { | |
"id": "sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149ebbusybox:latest", | |
"latest": "sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149eb", | |
"name": "busybox:latest" | |
} | |
} | |
}, | |
"docker_volume.dummy_volume": { | |
"type": "docker_volume", | |
"primary": null, | |
"tainted": [ | |
{ | |
"id": "dummy-volume", | |
"attributes": { | |
"driver": "local", | |
"id": "dummy-volume", | |
"mountpoint": "/var/lib/docker/volumes/dummy-volume/_data", | |
"name": "dummy-volume" | |
} | |
} | |
] | |
} | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment