Ansible with Xen Orchestra
-
Hi,
It's hard to answer since you aren't providing any detail on your XO installation. XOA or XO from the source? If sources, how is it configured? Which port it's listening?
-
@olivierlambert XO build from source listening on port 8443
-
If you followed the doc correctly (Node version, being entirely up to date), then it should work. Maybe it's the plugin. Any feedback for others in the community?
-
-
@hostingforyou said in Ansible with Xen Orchestra:
@olivierlambert XO build from source listening on port 8443
The plug-in doesn't make any assumptions about the port.
Can you try with
api_host: "10.10.1.120:8443"
? -
@shinuza thanks, that works.
after changing to api_host: "10.10.1.120:8443"
[WARNING]: * Failed to parse /opt/system/inventories/production/xen_orchestra.yml with auto plugin: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: IP address mismatch, certificate is not valid for '10.10.1.120'. (_ssl.c:997)
setting validate_certs: false gave me the working output
looks very nice
-
This post is deleted! -
Is their a way to use the ansible plugin for creating VM's in XCP-NG?
-
@hostingforyou Hi !
The best way to create VM is with the terraform provider for Xen Orchestra
See https://xen-orchestra.com/blog/virtops1-xen-orchestra-terraform-provider/ -
@AtaxyaNetwork looks good, not sure to post issue here as its is not ansible related, but I get the following error:
$ terraform plan Planning failed. Terraform encountered an error while generating this plan. ╷ │ Error: unexpected EOF │ │ with provider["registry.terraform.io/terra-farm/xenorchestra"], │ on provider.tf line 10, in provider "xenorchestra": │ 10: provider "xenorchestra" {
$ cat provider.tf # provider.tf terraform { required_providers { xenorchestra = { source = "terra-farm/xenorchestra" version = "~> 0.9" } } } provider "xenorchestra" { username = "xo" password = "password" url = "ws://10.10.1.120:8443" insecure = true }
$ cat vm.tf data "xenorchestra_pool" "pool" { name_label = "OTA" } data "xenorchestra_template" "vm_template" { name_label = "Ubuntu-22-template" } data "xenorchestra_sr" "sr" { name_label = "Tintri-Intern-Intern01" pool_id = data.xenorchestra_pool.pool.id } data "xenorchestra_network" "network" { name_label = "LAN Private" pool_id = data.xenorchestra_pool.pool.id }
any idea how to debug?
-
Hello all,
I'm running into a persistent issue when following the blog steps.
ansible-inventory -i ./my.xen_orchestra.yaml --list [WARNING]: * Failed to parse /home/cstreb/working/ansible/my.xen_orchestra.yaml with yaml plugin: Plugin configuration YAML file, not YAML inventory [WARNING]: * Failed to parse /home/cstreb/working/ansible/my.xen_orchestra.yaml with ini plugin: Invalid host pattern 'plugin:' supplied, ending in ':' is not allowed, this character is reserved to provide a port. [WARNING]: Unable to parse /home/cstreb/working/ansible/my.xen_orchestra.yaml as an inventory source [WARNING]: No inventory was parsed, only implicit localhost is available
contents of my.xen-orchestra.yaml file is as follows
plugin: community.general.xen_orchestra api_host: 192.168.2.203 #(XOA box?) Needs :443? user: <user> password: <pass>
Other relevant details
I'm using XO from source running on a different machine then my xcp-ngThis is my first time trying ansible at all so I may have missed a key step. Any help is appreciated.
EDIT: Fixed
Because I haven't forced HTTPS on my XO from Source box I needed to tell the file to configure to http (80)
then add the following arguments to the end of my filevalidate_certs: false
use_ssl: falseit now works.
-
Thanks @Nystral for your feedback!
-
It was once suggested to use Ansible's native generic command invoking functions, to automate and do infrastructure as code.
However people who are migrating from VMware can have a very detailed, infrastructure as code via Ansible. Also by having actual functions for invoking and setting up HA in Ansible for instance would be great. As well as other things such as managing the SRs, as well as creating and connecting them on XCP-ng hosts. So if any errors occur then it will be able to return, proper error codes appropriate to XOA and XCP-ng, rather than what is returned with the native generic Ansible command invoker.
The community has produced an extensive Ansible plugin for VMware products. So the new incoming customers may welcome a much, more extensive capabilities for Ansible when paired with XCP-ng and Xen Orchestra, beyond just Xen Orchestra inventory.
https://galaxy.ansible.com/ui/repo/published/community/vmware/docs/