Closed dc232 closed 3 years ago
@dc232 is the problem that the memory value is never updated? Or that Terraform is incorrectly determining the current value? The former is expected until #40 is addressed. The latter would be a new bug.
If that is the case apologies for not understanding your question correctly in Discord.
@ddelnano I suspect the answer is both my reasoning for this is that the max memory value was defined at the initial apply of the terraform file so it should already be set to 1073733632 not 8589934592 even when updating other changes within the terraform file
The initial terraform code for testing can be found below, for the VLAN I believe it needs to be changed to -1 to test if I remember correctly, if testing in default VLAN of 1
provider "xenorchestra" { #auths to the endpoint
url = var.endpoint
username = var.username
password = var.password
}
data "xenorchestra_pool" "pool" {
name_label = "xcp-ng-oejjmokz"
}
data "xenorchestra_sr" "sr" {
name_label = "Local storage"
pool_id = data.xenorchestra_pool.pool.id
}
data "xenorchestra_template" "template" {
name_label = "Kubernetes"
}
data "xenorchestra_pif" "pif" {
device = "eth0"
vlan = 10
}
resource "xenorchestra_cloud_config" "base" {
name = "cloudconfig"
template = <<EOF
#cloud-init
tiemzone: America/New_York
hostname: terraformtest
package_update: true
package_upgrade: true
users:
- name: test
gecos: Test User
groups: sudo
passwd: test
sudo: ['ALL=(ALL) NOPASSWD:ALL']
network:
version: 2
ethernets:
eno1:
dhcp4: no
addresses: [192.168.10.10/24]
gateway4: 192.168.10.1
nameservers:
addresses: [192.168.10.1]
runcmd:
- [ ls, -l, / ]
- [ sh, -xc, "echo $(date) ': hello world!'" ]
- [ sh, -c, echo "=========hello world'=========" ]
- ls -l /root
EOF
}
resource "xenorchestra_vm" "base" {
count = var.instance_count
memory_max = 1073733632
cpus = 2
cloud_config = xenorchestra_cloud_config.base.template
name_label = "TerraformVM-${count.index +1}"
name_description = "Created by Terraform Script"
template = data.xenorchestra_template.template.id
network {
network_id = data.xenorchestra_pif.pif.network
}
disk {
sr_id = data.xenorchestra_sr.sr.id
name_label = "Terraform_disk_imavo"
size = 32212254720
}
}
This was fixed in #144 and will be released in v0.19.0 of the provider!
when making changes to a vm resource and then running the terraform plan/apply command the max memory value does not change from the default an example can be seen below