You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
provider"vsphere" {
user=var.usernamepassword=var.passwordvsphere_server="localhost"allow_unverified_ssl=true
}
data"vsphere_datacenter""dc" {
name="dc1"
}
data"vsphere_datastore""datastore" {
name="datastore1"datacenter_id=data.vsphere_datacenter.dc.id
}
data"vsphere_resource_pool""pool" {
name="cluster1/Resources"datacenter_id=data.vsphere_datacenter.dc.id
}
data"vsphere_network""network" {
name="public"datacenter_id=data.vsphere_datacenter.dc.id
}
data"vsphere_content_library""library" {
name="img-library"
}
data"vsphere_content_library_item""item" {
name="windows-2019-in-content-library"library_id=data.vsphere_content_library.library.id
}
// can you compute template object from content library item?data"vsphere_virtual_machine""template" {
name="windows-2019"datacenter_id=data.vsphere_datacenter.dc.id
}
resource"vsphere_virtual_machine""vm" {
name="terraform-test"resource_pool_id=data.vsphere_resource_pool.pool.iddatastore_id=data.vsphere_datastore.datastore.idnum_cpus=2memory=8192// how would you get guest_id from the content library template?// this is not possible :(guest_id=data.vsphere_content_library_item.item.guest_idnetwork_interface {
network_id=data.vsphere_network.network.id
}
clone {
template_uuid=data.vsphere_content_library_item.item.idcustomize {
network_interface {
ipv4_address="10.0.0.10"ipv4_netmask=24
}
ipv4_gateway="10.0.0.1"
}
}
}
Debug Output
N/A
Panic Output
N/A
Expected Behavior
Expecting to compute template values like guest_id from content library item/template.
Actual Behavior
It's not documented how to compute template values from content library item.
It seems that the content library item only exports it's id value and nothing else. This is not possible:
Hi @Satak! Unfortunately there is not currently a way to get template values from content library. The content library API has limited information. I believe this is due to the fact that content library items do not necessarily need to be templates.
I have a PR (#1014) open to help alleviate the problem. Once that is merged and released, you can work around the lack of config attributes on content library items by first deploying a VM from content library, and then using that as your source.
Another option is to deploy the VM from content library, and leave guest_id blank. The only caveat is that you will need to ignore guest_id changes using the following:
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!
ghost
locked and limited conversation to collaborators
May 1, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Terraform Version
v0.12.24
vSphere Provider Version
v1.17.0
Affected Resource(s)
vsphere_virtual_machine
vsphere_content_library_item
Terraform Configuration Files
Debug Output
N/A
Panic Output
N/A
Expected Behavior
Expecting to compute template values like
guest_id
from content library item/template.Actual Behavior
It's not documented how to compute template values from content library item.
It seems that the content library item only exports it's
id
value and nothing else.This is not possible:
How to compute template values from content library item e.g. disk size and guest_id?
Steps to Reproduce
N/A
Important Factoids
N/A
References
The text was updated successfully, but these errors were encountered: