• What does the "core_os" setting do in vm terraform?

    3
    0 Votes
    3 Posts
    55 Views
    S

    @olivierlambert if that’s the case, great! I’m developing some modules for the xenorchestra terraform provider, and want to understand all the options.

  • 0 Votes
    1 Posts
    68 Views
    No one has replied
  • % characters in cloud-init configs render as 0 in instance

    Solved
    11
    0 Votes
    11 Posts
    227 Views
    olivierlambertO

    πŸŽ‰πŸŽ‰πŸŽ‰

  • Ansible with Xen Orchestra

    Moved
    26
    2 Votes
    26 Posts
    8k Views
    olivierlambertO

    Yes, we created the DevOps team so we'll have more bandwidth coming with it.

  • Unable to clone my template's disk

    Solved
    7
    0 Votes
    7 Posts
    196 Views
    AtaxyaNetworkA

    @bvivi57 Ah yes, good catch, I didn't think of that !

  • Terraform Creating VM from my Windows Templates No Bootable Device

    5
    0 Votes
    5 Posts
    261 Views
    O

    I was having this problem with my Debian 12 template when using terraform as well. I can confirm that rebuilding the template using "Other installation media" also fixed the problem for me. Thanks @SethNY .

  • Packer Created VMs Failing to Boot

    Moved
    28
    0 Votes
    28 Posts
    2k Views
    M

    Edit: Just had a thought, no idea if it's another potential workaround. In the builder you specify a template to clone that is used to create the VM. I'm on Xenserver 8, and there is no way through the GUI, but I think it might be possible to add an extra DVD-drive to a template? If that gets brought over to the packer vm, then that might be an option. Might need to do an eject from within the vm in order to dismount the dvd in order to not have it be part of the artifact though.

    @olivierlambert Sounds like the best way forward would be to add the equivalent of the Hyper-V builder's secondary_iso that mounts a second iso-file, or even better cd_files which creates a temporary iso for you and mounts it.

    For anyone who wants to test building eufi machines until this is solved, I have a Powershell script that takes a Windows ISO and generates a new one with files added (in my case autounattend.xml, bootstrap.ps1 and the management agent msi. Though I should change it to just download the msi instead to avoid rebuilding it.)

    Since I was building a new ISO anyway, I also changed the boot loader to the noprompt one in order to avoid the timing issues with boot_commands and "Press any key to boot from DVD...."

    The script uses oscdimg.exe that's included in the Windows ADK, which can be found here:
    https://learn.microsoft.com/en-us/windows-hardware/get-started/adk-install

    # Settings $Architecture = "amd64" # Or x86 $InputISOfile = "D:\Deploy\ISO\Windows Server 2022 Eval.iso" $OutputISOfile = "D:\Deploy\ISO\Windows Server 2022 Eval XenServer.iso" $TempFolder = "E:\Temp\Win2022XenServer" $AdditionalFiles = @( "C:\files\Autounattend.xml", "C:\files\bootstrap.ps1", "C:\\managementagentx64.msi" ) $OSCDIMG_Path = "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools" + "\$Architecture\Oscdimg" # Check environment If (!(Test-path $InputISOfile)){ Write-Warning "Input ISO file not found. Exiting";Break} If (!(Test-path $OSCDIMG_Path)){ Write-Warning "OSCDIMG Path not found. Exiting";Break} if((Test-Path $TempFolder)){ Write-Warning "Temp folder $TempFolder exists. Exiting.";Break} foreach($file in $AdditionalFiles) { if(!(Test-Path $$file)){ Write-Warning "Additional file $file does not exists. Exiting.";Break} } # Mount the original Windows ISO and figure out the drive-letter Mount-DiskImage -ImagePath $InputISOfile $ISOImage = Get-DiskImage -ImagePath $InputISOfile | Get-Volume $ISODrive = [string]$ISOImage.DriveLetter+":" # Copy ISO contents to temp dir and add additional files New-Item -Path $TempFolder -ItemType Directory -Force Copy-Item "$ISODrive\*" $TempFolder -Recurse if(($AdditionalFiles) -and $AdditionalFiles.Length -gt 0) { Copy-Item $AdditionalFiles $TempFolder } # Dismount the Original ISO Dismount-DiskImage -ImagePath $InputISOfile # Create a new bootable Windows ISO file, based on the Original ISO, but using efisys_noprompt.bin instead $BootData='2#p0,e,b"{0}"#pEF,e,b"{1}"' -f "$TempFolder\boot\etfsboot.com","$TempFolder\efi\microsoft\boot\efisys_noprompt.bin" $Proc = Start-Process -FilePath "$OSCDIMG_Path\oscdimg.exe" -ArgumentList @("-m","-o","-bootdata:$BootData",'-u2','-udfver102',"$TempFolder\","`"$OutputISOfile`"") -PassThru -Wait -NoNewWindow if($Proc.ExitCode -ne 0) { Throw "Failed to generate ISO with exitcode: $($Proc.ExitCode)" } Get-FileHash -Path $OutputISOfile -Algorithm SHA256 Remove-Item $TempFolder -recurse -force
  • Terraform create VyOS from ISO

    4
    0 Votes
    4 Posts
    206 Views
    S

    @AtaxyaNetwork Thank you for the feedback.

    It looks like there's now way around completing my VMs and converting to them templates. But that's ok!

    I took your advice and am successfully creating my own templates manually. One good thing with VyOS is I can enable xe-guest-utilities in the template, something I wanted to do in cloud-init.

    I will use Ansible to configure the router.

  • Extracting data from XO with terraformer

    10
    0 Votes
    10 Posts
    461 Views
    D

    @Gurve thank you for providing a full example!

  • submit provider to opentofu registry?

    7
    0 Votes
    7 Posts
    310 Views
    xyhhxX

    looks like it's been taken care of automatically! i'll give it a shot today-tomorrow and confirm

  • xoadmin cli/package tool

    1
    0 Votes
    1 Posts
    104 Views
    No one has replied
  • Terraform wait_for_ip Flag Returning APIPA Address

    7
    0 Votes
    7 Posts
    455 Views
    D

    @dan89 this is complete and available in v0.29.0 of the provider.

  • Ansible with OIDC/OpenID

    3
    0 Votes
    3 Posts
    321 Views
    U

    @TITUS-MAXIMUS
    what kind of logs would you like to see, there are none,
    since in sourcecode is only username and password option

    https://github.com/ansible-collections/community.general/blob/102a0857db23905cdfa2e2fdae531eb5d2043b9a/plugins/inventory/xen_orchestra.py#L169

    and it is also required to be filled in

    My question is, if there is a way to login with oidc just like in this plugin
    87f8c519-f4de-4677-9590-9dba4c22a0d3-obrazek.png
    https://docs.ansible.com/ansible/latest/collections/netbox/netbox/nb_inventory_inventory.html

  • Vates Supporting OpenTofu (Terraform alternative)

    Moved
    6
    2 Votes
    6 Posts
    1k Views
    D

    @brodiecyber no worries and I hope you are doing better and staying healthy!

    Just wanted to give you an update that the terraform provider is currently testing against multiple versions of terraform (v0.14.11 and v1.6.5). The build matrix will be easy to extend to support OpenTofu testing, so we should be able to integrate that testing soon.

  • terraform: XO response: jsonrpc2: code 10 message

    Moved
    6
    0 Votes
    6 Posts
    504 Views
    AtaxyaNetworkA

    @twaapo @ddelnano Hi !

    I think the problem is here:

    installation:map[method:network repository:]

    You need to have some value for the var "repository"

    After some digging in internet, XAPI code (because why not), I found the solution in an old commit in the XO repo:
    https://github.com/vatesfr/xen-orchestra/commit/07bf93e022a0026cacf28bf8797646361f7ea4a6

    I think the var need to be set to "pxe"
    (i'm doing some more digging)

    0 julien-f committed to vatesfr/xen-orchestra Add PXE installation method for HVM templates. (fix #436)
  • cannot create a VM from a diskless template without an ISO #274

    Moved
    11
    0 Votes
    11 Posts
    495 Views
    gudge25G

    @AtaxyaNetwork
    https://pastebin.com/raw/q6qMn73M

    and file

    cloud_config.tftpl file used by the cloudinit templating.

    #cloud-config
    hostname: ${hostname}
    fqdn: ${hostname}.${domain}
    package_upgrade: true

  • How to configure multiple networks on a VM with Terraform

    Moved
    12
    0 Votes
    12 Posts
    2k Views
    M

    @ddelnano My goal is to have one DHCP (on my LAN) network and 0 or 1 private networks per VM.

    The way I have my module setup currently I will just have one network created via Terraform. The main part I'm having trouble with is the second network being conditionally created with or without a MAC assigned.

    If I use a dynamic block, all the network options will be configured for each network. There's really only two situations I want the module to work for.

    a single network that has a MAC assigned one network with a MAC assigned and another network without a MAC assigned and on a different pool network.

    Until I can figure out whether it's possible I just created a second module that uses two networks.

    One idea I had was to use a a complex list(object) variable where each item in the list has a network name and a boolean that determines whether or not to assign a MAC from the pre-populated list but I could not get things going the right direction using the same variable for a terraform data object (used to get the ID associated with the named network) then also for the dynamic network block, having each network only assign a MAC conditionally.
    If that was possible it would allow much more freedom to create whatever combination of network connections I wanted. If possible it would check for a specific network name that would always get a MAC assigned and another that never gets a MAC.

    I am currently using the network name, from a list variable, to create a data object that provides the network ID for use in the xenorchestra_vm network block. I had trouble figuring out how to do that for two networks and be able to access the ID for each and get the MAC boolean conditionally applied to the network data object or objects.

  • Xen-Orchestra Terraform provider and Windows

    Moved
    34
    0 Votes
    34 Posts
    7k Views
    V

    @rochemike
    I had the same issue as you did.

    To get around this error.
    "β”‚ Error: jsonrpc2: code 10 message: invalid parameters: {"errors":[{"instancePath":"/VIFs/0/mac","schemaPath":"#/properties/VIFs/items/properties/mac/minLength","keyword":"minLength","params":{"limit":1},"message":"must NOT have fewer than 1 characters"}]}
    β”‚
    β”‚ with xenorchestra_vm.rbbmspcs2,
    β”‚ on vm-windows.tf line 19, in resource "xenorchestra_vm""rbbmspcs2":
    β”‚ 19: resource "xenorchestra_vm""rbbmspcs2" {"

    I modified the tf file to pass a mac_address

    network { network_id = data.xenorchestra_network.cladevops01net1.id mac_address = be:d0:74:96:5a:66 }

    It would then go and create the VM but once created. I'd log into XO, delete the VIF and readd it to get the randomized MAC address.

    Please note that I also tried mac_address = null and mac_address = random which also failed.

    Hope it helps.

  • Terraform Error jsonrpc2: code 10 message

    Moved
    4
    0 Votes
    4 Posts
    312 Views
    D

    @mlustosa apologies for the slow response on that issue. I'm hoping to around to addressing that within the next week or so and thanks for posting the workaround on the related issue.

  • Using Terraform and packer-plugin-xenserver for Talos Linux

    Moved
    2
    0 Votes
    2 Posts
    940 Views
    D

    Hi @slynch, I unfortunately don't have any experience with Talos Linux. It seems like a very promising project.

    Creating packer images with the xenserver packer plugin is OS dependent. The Ubuntu and CentOS examples provided in the repo use autoinstallation and kickstart respectively.

    Is Talos Linux based on an existing distro that has an existing unattended / automatic install solution? I think the key to accomplishing this is using an off the shelf auto install tool or finding something that will work for Talos.

    Talos's nocloud data source will likely be part of this solution, however, for the existing examples it's just a means for configuring the auto install tool for the target distro.

    There are two platforms they support that they document using Packer - Hetzner and Upcloud - but I can't figure out how to use that knowledge to get this to work with packer-plugin-xenserver.

    While I'm not familiar with the the Hetzner and Upcloud packer plugins, it seems there "examples" are essentially booting a VM and then dd'ing the raw.xz file over top of a disk device. So unfortunately I don't think those examples will be useful for implementing this with the xenserver packer plugin.

    Screenshot_20230330_231257.png