terra-farm / terraform-provider-xenserver

XenServer provider for Terraform
https://terra-farm.github.io/provider-xenserver/
MIT License
72 stars 36 forks source link

API Error: PERMISSION_DENIED when tainting VM #36

Open chafey opened 6 years ago

chafey commented 6 years ago

Steps: 1) terraform apply 2) terraform taint xenserver_vm.xxx-vm 3) terraform apply

I get the following error:

Error: Error applying plan:

1 error(s) occurred:

* xenserver_vdi.xxx_data_vdi: 1 error(s) occurred:

* xenserver_vdi.xxx_data_vdi: API Error: PERMISSION_DENIED  

here is my TF:

resource "xenserver_vdi" "xxx_data_vdi" {
  sr_uuid = "4758064c-924a-c671-9c26-8321b6c207c8"
  name_label = "xxx-data-vdi"
  size = 20073741824 # 20GB
}

resource "xenserver_vm" "xxx-vm" {
  base_template_name = "Ubuntu 16.04 Template"
  name_label = "xxx-ubuntu-vdi"
  static_mem_min = 8589934592
  static_mem_max = 8589934592
  dynamic_mem_min = 8589934592
  dynamic_mem_max = 8589934592
  vcpus = 1
  boot_order = "c"

 hard_drive {
  vdi_uuid = "${xenserver_vdi.xxx_data_vdi.id}"
  is_from_template = false
  bootable = false
  mode = "RW"
}

 hard_drive {
    is_from_template = true
    user_device = "0"
  } # Template VM HDD

  cdrom {
        is_from_template = true
        user_device = "3"
    }
}
chafey commented 6 years ago

Any ideas? I would expect the VM to be rebuilt and attached to the existing VDI (where I would store my persistent data)

ringods commented 6 years ago

@chafey sorry, but I haven't had the time so far to look into this. Will probably be coming weekend the earliest.