XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    OpenTofu - create VM from named template in the configured pool

    Scheduled Pinned Locked Moved Infrastructure as Code
    1 Posts 1 Posters 19 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G Offline
      graham_p
      last edited by

      We are successfully using OpenTofu to deploy VMs in a single pool.

      In our case, we have two pools (Test & Production). XO allows you to create or import a template with the same name into each pool. This is reasonable.

      When deploying a VM with tofu, first we configure the pool we are using with xenorchestra_pool. But when we configure xenorchestra_vm and select the template by name, tofu fails because it sees both templates with the same name - and ignores the fact that they are in different pools.

      found `2` templates with query {Id: Uuid: Boot:{Firmware: Order:} NameLabel:<my_template_name> PoolId: TemplateInfo:{Arch: Disks:[]} VBDs:[]}. Templates must be uniquely named to use this data source
      

      The templates ARE uniquely named, within their pool, as permitted by XO. Would it be possible please for the tofu VM resource to search for the template in the pool that has been configured?

      Many thanks,
      Graham

      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post