-
Notifications
You must be signed in to change notification settings - Fork 114
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
bug: ntx provider have ENTITY_READ_ERROR when try to recreate a VM deleted manually #451
Comments
Hey @guiadco , I tried the steps you mentioned but it worked for me. I didn't got any error. Are you still facing this issue ? |
Hi, |
Hi, I'm still facing the issue: │ Error: error checking virtual Virtual Machine ddfbde0d-ff29-4c80-8284-85296f053d8e existence: error: {
│ "api_version": "3.1",
│ "code": 404,
│ "kind": "vm",
│ "message_list": [
│ {
│ "message": "vm : ddfbde0d-ff29-4c[80](http://server/project/sdpl_workspace/-/jobs/138#L80)-8284-85296f053d8e could not be read.",
│ "reason": "ENTITY_READ_ERROR"
│ }
│ ],
│ "state": "ERROR"
│ }
│
│ with nutanix_virtual_machine.gitea,
│ on g3s-gitea.tf line 1, in resource "nutanix_virtual_machine" "gitea":
│ 1: resource "nutanix_virtual_machine" "gitea" { |
Hi, I tried again and it works for me.
nutanix_virtual_machine.bastion has been deletedSteps, I am following.
Can you share tf config/ gist ? |
Provider configterraform {
required_providers {
nutanix = {
source = "nutanix/nutanix"
version = "1.6.1"
}
}
}
provider "nutanix" {
username = var.nutanix_username
password = var.nutanix_password
endpoint = var.nutanix_endpoint
insecure = true
wait_timeout = 10
} VM Config resource "nutanix_virtual_machine" "gitea" {
name = "${var.env}-gitea"
description = "This resource is managed by Terraform, please don't touch"
num_vcpus_per_socket = 4
num_sockets = 1
memory_size_mib = 4096
cluster_uuid = data.nutanix_cluster.cluster1.cluster_id
nic_list {
subnet_uuid = data.nutanix_subnet.subnet_id.subnet_id
ip_endpoint_list {
ip = var.gitea-ip
type = "ASSIGNED"
}
}
disk_list {
data_source_reference = {
uuid = data.nutanix_image.image_ref.image_id
kind = "image"
}
disk_size_mib = 40000
}
disk_list {
disk_size_mib = 40240
device_properties {
device_type = "DISK"
disk_address = {
"adapter_type" = "SCSI"
"device_index" = "1"
}
}
}
} I delete the VM manually: ➜ make plan-dev
. ./env.dev
terraform init --reconfigure
Initializing the backend...
Successfully configured the backend "http"! Terraform will automatically
use this backend unless the backend configuration changes.
Initializing provider plugins...
- Reusing previous version of nutanix/nutanix from the dependency lock file
- Using previously-installed nutanix/nutanix v1.6.1
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
terraform plan -var-file=dev/terraform.tfvars -var="nutanix_password=${NTX_PASSWORD}"
data.nutanix_image.image_ref: Reading...
data.nutanix_cluster.cluster1: Reading...
data.nutanix_subnet.subnet_id_STO: Reading...
data.nutanix_subnet.subnet_id: Reading...
data.nutanix_subnet.subnet_id_DMZ: Reading...
data.nutanix_subnet.subnet_id: Read complete after 0s [id=ed631dc6-75f4-4deb-85e6-9a8684042d92]
data.nutanix_subnet.subnet_id_STO: Read complete after 0s [id=6d566fdc-9334-4dcf-b40a-2ff67a254a4e]
data.nutanix_subnet.subnet_id_DMZ: Read complete after 0s [id=d3e00a3d-ab16-4a0f-98b3-c19aafcfa05e]
data.nutanix_cluster.cluster1: Read complete after 0s [id=0005d048-d903-fb59-0000-000000024cec]
data.nutanix_image.image_ref: Read complete after 0s [id=dfbd2b0e-0883-4c84-8571-8274a93570e0]
nutanix_virtual_machine.g3s-px[1]: Refreshing state... [id=83b32396-7ed7-4af2-bf20-e98582b49f6e]
nutanix_virtual_machine.kcm-pri-master[1]: Refreshing state... [id=aded74ae-eafe-41eb-b113-538ce3410d5e]
nutanix_virtual_machine.g3s-gsit: Refreshing state... [id=985aad61-ed19-4f16-89e5-f0bc10b83389]
nutanix_virtual_machine.g3s-brs: Refreshing state... [id=a8502cdf-b948-4cb7-9779-a654dc486b12]
nutanix_virtual_machine.g3s-brs-client-alpha: Refreshing state... [id=d32541f0-2375-461b-851d-4d6508d7a05b]
nutanix_virtual_machine.kcm-pri-master[0]: Refreshing state... [id=33777ffc-96c2-4bee-b747-05d78672dafd]
nutanix_virtual_machine.kcm-pri-master[2]: Refreshing state... [id=cb1f3543-9ee2-49bf-8daf-4b9370d8cafb]
nutanix_virtual_machine.g3s-tsp: Refreshing state... [id=0bf60463-b160-4308-b60b-4d70542f14d6]
nutanix_virtual_machine.g3s-px[0]: Refreshing state... [id=b06f2701-6427-4ea5-90c8-02da6491767d]
nutanix_virtual_machine.g3s-gitea: Refreshing state... [id=76fabca9-461c-4a01-907a-6bbc26f73c7c]
nutanix_virtual_machine.g3s-logm-es[0]: Refreshing state... [id=5c488465-4ab0-46b0-baba-3fd2c176ca58]
nutanix_virtual_machine.g3s-logm-es[1]: Refreshing state... [id=90a548f0-d417-456d-8f37-13c59e4cb826]
nutanix_virtual_machine.g3s-logm-es[2]: Refreshing state... [id=3dbbe1f9-e6f5-4743-8b4c-614320ec1eeb]
nutanix_virtual_machine.dmz_syslog_entrypoint_01[0]: Refreshing state... [id=3535a7d4-015d-48ce-bf2a-37489ebc906b]
nutanix_virtual_machine.dmz_syslog_entrypoint_01[1]: Refreshing state... [id=1b712624-b6b8-406c-855a-32942c2b45e2]
nutanix_virtual_machine.g3s-tsp-dmz: Refreshing state... [id=2ddd4f9f-6e86-47bd-8837-11885ef6a494]
nutanix_virtual_machine.syslog_entrypoint_01[0]: Refreshing state... [id=c9bb76f1-d28e-4e30-8789-c9fe729bf0b5]
nutanix_virtual_machine.syslog_entrypoint_01[1]: Refreshing state... [id=c91872fd-7889-4598-b46a-5a69c0381910]
nutanix_virtual_machine.g3s-logm-clust[0]: Refreshing state... [id=fbeef8f5-b685-4451-abe9-05b02a537619]
nutanix_virtual_machine.g3s-logm-clust[1]: Refreshing state... [id=7e2f0798-152a-4dc3-aaf8-077cea7572b0]
nutanix_virtual_machine.g3s-logm-clust[2]: Refreshing state... [id=96f57204-8e7b-45d4-acc7-969dbe064654]
nutanix_virtual_machine.g3s-rpx[0]: Refreshing state... [id=16d1c05a-422e-4d77-b411-692729505030]
nutanix_virtual_machine.g3s-rpx[1]: Refreshing state... [id=b4f108e2-a180-44c6-8faf-9ffc588c7b65]
nutanix_virtual_machine.kcm-dmz-master[0]: Refreshing state... [id=0585830d-dfdf-4edd-a49f-5fc4057dd90f]
nutanix_virtual_machine.kcm-dmz-master[1]: Refreshing state... [id=fc484cb7-fd1d-46db-b2a9-66975fe794dd]
nutanix_virtual_machine.kcm-dmz-master[2]: Refreshing state... [id=ebb12704-d666-435d-935c-3ecf4fde42ad]
nutanix_virtual_machine.kcm-dmz-worker[1]: Refreshing state... [id=e5b7b035-45f1-4651-b91f-0eae510cc95c]
nutanix_virtual_machine.kcm-dmz-worker[0]: Refreshing state... [id=5ef26e2b-b55c-4951-b63e-90ed8d7683d6]
nutanix_virtual_machine.kcm-dmz-worker[2]: Refreshing state... [id=adfeec56-98f5-44a6-859d-c9b75f4af77d]
nutanix_virtual_machine.kcm-pri-worker[2]: Refreshing state... [id=9b180367-b9a3-4544-a267-6b47cbfde879]
nutanix_virtual_machine.kcm-pri-worker[0]: Refreshing state... [id=24954b72-ffbf-45dd-80bd-e9c9f5acfa2b]
nutanix_virtual_machine.kcm-pri-worker[1]: Refreshing state... [id=cbb020f8-834e-49bf-b9b2-277e0255fe2e]
╷
│ Warning: Disabled Providers: foundation. Please provide required fields in provider configuration to enable them. Refer docs.
│
│ with provider["registry.terraform.io/nutanix/nutanix"],
│ on providers.tf line 10, in provider "nutanix":
│ 10: provider "nutanix" {
│
╵
╷
│ Error: error checking virtual Virtual Machine 76fabca9-461c-4a01-907a-6bbc26f73c7c existence: error: {
│ "api_version": "3.1",
│ "code": 404,
│ "kind": "vm",
│ "message_list": [
│ {
│ "message": "vm : 76fabca9-461c-4a01-907a-6bbc26f73c7c could not be read.",
│ "reason": "ENTITY_READ_ERROR"
│ }
│ ],
│ "state": "ERROR"
│ }
│
│ with nutanix_virtual_machine.g3s-gitea,
│ on g3s-gitea.tf line 1, in resource "nutanix_virtual_machine" "g3s-gitea":
│ 1: resource "nutanix_virtual_machine" "g3s-gitea" {
│
╵
make: *** [Makefile:10: plan-dev] Error 1
➜ make apply-dev
terraform apply --auto-approve -var-file=dev/terraform.tfvars -var="nutanix_password=${NTX_PASSWORD}"
data.nutanix_subnet.subnet_id_DMZ: Reading...
data.nutanix_image.image_ref: Reading...
data.nutanix_subnet.subnet_id_STO: Reading...
data.nutanix_cluster.cluster1: Reading...
data.nutanix_subnet.subnet_id: Reading...
data.nutanix_subnet.subnet_id: Read complete after 0s [id=ed631dc6-75f4-4deb-85e6-9a8684042d92]
data.nutanix_subnet.subnet_id_STO: Read complete after 0s [id=6d566fdc-9334-4dcf-b40a-2ff67a254a4e]
data.nutanix_image.image_ref: Read complete after 0s [id=dfbd2b0e-0883-4c84-8571-8274a93570e0]
data.nutanix_subnet.subnet_id_DMZ: Read complete after 0s [id=d3e00a3d-ab16-4a0f-98b3-c19aafcfa05e]
data.nutanix_cluster.cluster1: Read complete after 0s [id=0005d048-d903-fb59-0000-000000024cec]
nutanix_virtual_machine.g3s-tsp-dmz: Refreshing state... [id=2ddd4f9f-6e86-47bd-8837-11885ef6a494]
nutanix_virtual_machine.kcm-dmz-worker[1]: Refreshing state... [id=e5b7b035-45f1-4651-b91f-0eae510cc95c]
nutanix_virtual_machine.kcm-pri-master[2]: Refreshing state... [id=cb1f3543-9ee2-49bf-8daf-4b9370d8cafb]
nutanix_virtual_machine.kcm-pri-master[0]: Refreshing state... [id=33777ffc-96c2-4bee-b747-05d78672dafd]
nutanix_virtual_machine.kcm-dmz-worker[0]: Refreshing state... [id=5ef26e2b-b55c-4951-b63e-90ed8d7683d6]
nutanix_virtual_machine.kcm-dmz-worker[2]: Refreshing state... [id=adfeec56-98f5-44a6-859d-c9b75f4af77d]
nutanix_virtual_machine.kcm-pri-master[1]: Refreshing state... [id=aded74ae-eafe-41eb-b113-538ce3410d5e]
nutanix_virtual_machine.kcm-pri-worker[0]: Refreshing state... [id=24954b72-ffbf-45dd-80bd-e9c9f5acfa2b]
nutanix_virtual_machine.g3s-brs: Refreshing state... [id=a8502cdf-b948-4cb7-9779-a654dc486b12]
nutanix_virtual_machine.kcm-pri-worker[1]: Refreshing state... [id=cbb020f8-834e-49bf-b9b2-277e0255fe2e]
nutanix_virtual_machine.kcm-pri-worker[2]: Refreshing state... [id=9b180367-b9a3-4544-a267-6b47cbfde879]
nutanix_virtual_machine.g3s-rpx[0]: Refreshing state... [id=16d1c05a-422e-4d77-b411-692729505030]
nutanix_virtual_machine.g3s-rpx[1]: Refreshing state... [id=b4f108e2-a180-44c6-8faf-9ffc588c7b65]
nutanix_virtual_machine.g3s-logm-es[0]: Refreshing state... [id=5c488465-4ab0-46b0-baba-3fd2c176ca58]
nutanix_virtual_machine.g3s-logm-es[2]: Refreshing state... [id=3dbbe1f9-e6f5-4743-8b4c-614320ec1eeb]
nutanix_virtual_machine.g3s-logm-es[1]: Refreshing state... [id=90a548f0-d417-456d-8f37-13c59e4cb826]
nutanix_virtual_machine.g3s-tsp: Refreshing state... [id=0bf60463-b160-4308-b60b-4d70542f14d6]
nutanix_virtual_machine.kcm-dmz-master[0]: Refreshing state... [id=0585830d-dfdf-4edd-a49f-5fc4057dd90f]
nutanix_virtual_machine.kcm-dmz-master[1]: Refreshing state... [id=fc484cb7-fd1d-46db-b2a9-66975fe794dd]
nutanix_virtual_machine.kcm-dmz-master[2]: Refreshing state... [id=ebb12704-d666-435d-935c-3ecf4fde42ad]
nutanix_virtual_machine.g3s-logm-clust[2]: Refreshing state... [id=96f57204-8e7b-45d4-acc7-969dbe064654]
nutanix_virtual_machine.g3s-logm-clust[0]: Refreshing state... [id=fbeef8f5-b685-4451-abe9-05b02a537619]
nutanix_virtual_machine.g3s-logm-clust[1]: Refreshing state... [id=7e2f0798-152a-4dc3-aaf8-077cea7572b0]
nutanix_virtual_machine.g3s-gsit: Refreshing state... [id=985aad61-ed19-4f16-89e5-f0bc10b83389]
nutanix_virtual_machine.syslog_entrypoint_01[0]: Refreshing state... [id=c9bb76f1-d28e-4e30-8789-c9fe729bf0b5]
nutanix_virtual_machine.syslog_entrypoint_01[1]: Refreshing state... [id=c91872fd-7889-4598-b46a-5a69c0381910]
nutanix_virtual_machine.g3s-px[0]: Refreshing state... [id=b06f2701-6427-4ea5-90c8-02da6491767d]
nutanix_virtual_machine.g3s-px[1]: Refreshing state... [id=83b32396-7ed7-4af2-bf20-e98582b49f6e]
nutanix_virtual_machine.dmz_syslog_entrypoint_01[0]: Refreshing state... [id=3535a7d4-015d-48ce-bf2a-37489ebc906b]
nutanix_virtual_machine.dmz_syslog_entrypoint_01[1]: Refreshing state... [id=1b712624-b6b8-406c-855a-32942c2b45e2]
nutanix_virtual_machine.g3s-brs-client-alpha: Refreshing state... [id=d32541f0-2375-461b-851d-4d6508d7a05b]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# nutanix_virtual_machine.g3s-gitea will be created
+ resource "nutanix_virtual_machine" "g3s-gitea" {
+ api_version = (known after apply)
+ availability_zone_reference = (known after apply)
+ boot_device_disk_address = (known after apply)
+ boot_device_mac_address = (known after apply)
+ boot_device_order_list = (known after apply)
+ boot_type = (known after apply)
+ cloud_init_cdrom_uuid = (known after apply)
+ cluster_name = (known after apply)
+ cluster_uuid = "0005d048-d903-fb59-0000-000000024cec"
+ description = "This resource is managed by Terraform, please don't touch"
+ enable_cpu_passthrough = false
+ enable_script_exec = (known after apply)
+ guest_customization_cloud_init_custom_key_values = (known after apply)
+ guest_customization_cloud_init_meta_data = (known after apply)
+ guest_customization_cloud_init_user_data = (known after apply)
+ guest_customization_is_overridable = (known after apply)
+ guest_customization_sysprep = (known after apply)
+ guest_customization_sysprep_custom_key_values = (known after apply)
+ guest_os_id = (known after apply)
+ hardware_clock_timezone = (known after apply)
+ host_reference = (known after apply)
+ hypervisor_type = (known after apply)
+ id = (known after apply)
+ is_vcpu_hard_pinned = false
+ machine_type = (known after apply)
+ memory_size_mib = 4096
+ metadata = (known after apply)
+ name = "g3s-dev-gitea"
+ ngt_credentials = (known after apply)
+ ngt_enabled_capability_list = (known after apply)
+ nic_list_status = (known after apply)
+ num_sockets = 1
+ num_vcpus_per_socket = 4
+ num_vnuma_nodes = (known after apply)
+ nutanix_guest_tools = (known after apply)
+ owner_reference = (known after apply)
+ parent_reference = (known after apply)
+ power_state = (known after apply)
+ power_state_mechanism = (known after apply)
+ project_reference = (known after apply)
+ should_fail_on_script_failure = (known after apply)
+ state = (known after apply)
+ use_hot_add = true
+ vga_console_enabled = (known after apply)
+ categories {
+ name = (known after apply)
+ value = (known after apply)
}
+ disk_list {
+ data_source_reference = {
+ "kind" = "image"
+ "uuid" = "dfbd2b0e-0883-4c84-8571-8274a93570e0"
}
+ disk_size_bytes = (known after apply)
+ disk_size_mib = 40000
+ uuid = (known after apply)
+ volume_group_reference = (known after apply)
+ device_properties {
+ device_type = (known after apply)
+ disk_address = (known after apply)
}
+ storage_config {
+ flash_mode = (known after apply)
+ storage_container_reference {
+ kind = (known after apply)
+ name = (known after apply)
+ url = (known after apply)
+ uuid = (known after apply)
}
}
}
+ disk_list {
+ data_source_reference = (known after apply)
+ disk_size_bytes = (known after apply)
+ disk_size_mib = 40240
+ uuid = (known after apply)
+ volume_group_reference = (known after apply)
+ device_properties {
+ device_type = "DISK"
+ disk_address = {
+ "adapter_type" = "SCSI"
+ "device_index" = "1"
}
}
+ storage_config {
+ flash_mode = (known after apply)
+ storage_container_reference {
+ kind = (known after apply)
+ name = (known after apply)
+ url = (known after apply)
+ uuid = (known after apply)
}
}
}
+ gpu_list {
+ device_id = (known after apply)
+ fraction = (known after apply)
+ frame_buffer_size_mib = (known after apply)
+ guest_driver_version = (known after apply)
+ mode = (known after apply)
+ name = (known after apply)
+ num_virtual_display_heads = (known after apply)
+ pci_address = (known after apply)
+ uuid = (known after apply)
+ vendor = (known after apply)
}
+ nic_list {
+ is_connected = "true"
+ mac_address = (known after apply)
+ model = (known after apply)
+ network_function_chain_reference = (known after apply)
+ network_function_nic_type = (known after apply)
+ nic_type = (known after apply)
+ num_queues = (known after apply)
+ subnet_name = (known after apply)
+ subnet_uuid = "ed631dc6-75f4-4deb-85e6-9a8684042d92"
+ uuid = (known after apply)
+ ip_endpoint_list {
+ ip = "10.x.x.x"
+ type = "ASSIGNED"
}
}
}
Plan: 1 to add, 0 to change, 0 to destroy.
nutanix_virtual_machine.g3s-gitea: Creating...
nutanix_virtual_machine.g3s-gitea: Still creating... [10s elapsed]
nutanix_virtual_machine.g3s-gitea: Creation complete after 17s [id=d3a96686-fc93-4170-9169-7b3a965d0ea8]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed. Could it be a retention to nutanix side? |
Can you share PC version ? |
Hi, You are getting this issue as you’re pointing terraform to Prism Element(PE) instead of Prism Central(PC). We recommend you to use PC as they’re validated. |
Ok sorry my bad, I try it :) |
Closing this issue. Feel free to reopen if issue persists . |
Nutanix Cluster Information
Terraform Version
Terraform Configuration Files
Debug Output
terraform state rm nutanix_virtual_machine.bastion
Normaly, terraform recreate VM if manually delete
Panic Output
Expected Behavior
Actual Behavior
Steps to Reproduce
terraform apply
terraform apply
Important Factors
References
The text was updated successfully, but these errors were encountered: