Open zzzuzik opened 6 years ago
I believe that I may have encountered this issue at one point, but I cannot remember what I did to fix it! What version of the provider are you using and can you paste a copy of the Terraform configuration, please?
I pulled the master go get github.com/ringods/terraform-provider-xenserver
the TF is quiet simple.
provider:
provider "xenserver" {
url = "https://xxxx"
username = "xxxx"
password = "xxx"
}
vm:
resource "xenserver_vm" "test" {
base_template_name = "my_template_on_xen"
name_label = "new_vm"
# 8G
static_mem_min = 8589934592
static_mem_max = 8589934592
dynamic_mem_min = 8589934592
dynamic_mem_max = 8589934592
vcpus = 4
boot_order = "cdn"
hard_drive {
is_from_template = true
user_device = "0"
}
cdrom {
is_from_template = true
user_device = "1" #also tried with 3
}
network_interface {
network_uuid = "7254fcf8-b982-41ea-aab2-455fee47308b"
device = 0
mtu = 1500
mac = ""
other_config {
ethtool-gso = "off"
ethtool-ufo = "off"
ethtool-tso = "off"
ethtool-sg = "off"
ethtool-tx = "off"
ethtool-rx = "off"
}
}
}
I am having the same problem with xen server 7.3. I am pretty sure it started creating VM's at one point, but now it seems stuck just creating templates
Same issue here on 7.2.
to fix my problem:
API Error: HANDLE_INVALID VDI OpaqueRef:NULL
the base template CD-ROM HAS to have guest_tool.iso in it AND the TF should look like this:
cdrom {
is_from_template = true
user_device = "2" # notice 2
}
zzzuzik - I updated my template to have guest_tool.iso in it and it worked, but I had to leave user_device="3". Thanks for the tip!
How are you finding the guest_tool.iso; can you show me a working version to built and boot a VM?
warmfusion - guest_tool.iso is included in xenserver. What I did was this:
Then I used this code with my new template name and everything ran:
provider "xenserver" {
url = "https://<server-address>"
username = "root"
password = "<xenserver-password>"
}
resource "xenserver_vm" "ubuntu" {
base_template_name = "Ubuntu 16.04 New Template"
name_label = "ubuntu_new_terraform"
static_mem_min = 8589934592
static_mem_max = 8589934592
dynamic_mem_min = 8589934592
dynamic_mem_max = 8589934592
vcpus = 1
boot_order = "c"
hard_drive {
is_from_template = true
user_device = "0"
}
cdrom {
is_from_template = true
user_device = "3"
}
network_interface {
network_uuid = "<Your Network UUID>"
device = "0"
mtu = 1500
mac = ""
other_config {
ethtool-gso = "off"
ethtool-ufo = "off"
ethtool-tso = "off"
ethtool-sg = "off"
ethtool-tx = "off"
ethtool-rx = "off"
}
}
}
We're also experiencing this issue on the latest XCP-ng hosts which is a XenServer 7x fork. Has anyone figured out the root cause yet, or proposed a workaround?
Hi @ringods and @mborodin thank you for working on this gem.
My TF is failing (minimized example version) to actually start VM, just template is created. No error in after applying, just "1 added" The trace shows this:
Could you please point me to where should I dig further.
TF.11.03 XS: 7.1ECU1 The base template is healthy, has 1 disk. I can spin up VMs from it within 3 seconds