terra-farm / terraform-provider-xenserver

XenServer provider for Terraform
https://terra-farm.github.io/provider-xenserver/
MIT License
73 stars 36 forks source link

Add actual example #19

Closed briantopping closed 6 years ago

briantopping commented 6 years ago

This was ripped from #17.

ringods commented 6 years ago

Tnx!

debovema commented 6 years ago

Hello,

I tested this "actual example" with Terraform 0.10.7 and terraform-provider-xenserver 0.2.0 against a fresh Xen Server 7.2 installation (set up with https://github.com/ringods/xenserver-images), here are the errors:

After replacing with "CentOS 7" the template name which actually exists:

So what does this UUID mean ? Is it a specific value for your Xen Server instance ? Where can I find it ?

Thanks for your help

mborodin commented 6 years ago

Hello @debovema, in this example there are several assumptions and it should be used as a reference or bluprint only, since actual values depend on resources (templates, networks etc) available to your XenServer. For example, I've created on my server template with preinstalled and preconfigured CentOS and called it "CentOS 7.4 Template". If you use other templates you will need to tweak settings in this example accordingly, for example create VDIs and attach them as hard drives, attach ISO image to install CentOS and so on. Regarding you second question about UUID of the network - in this particular case it was UUID of some network, available on my server. You can get UUIDs of your networks with xe tool:

root@xenserver # xe network-list

In more broad sense UUIDs in XenServer serve as identifiers to different resources created, like VMs, VDIs, networks and so on. To obtain UUID of a required resource currently you will need to use xe tool similar to example above, but in future in will be available to query XenServer directly from terraform.

Hope this helps to solve your issue.

briantopping commented 6 years ago

@debovema: If you take a look at the content that was there before, it was ..., this was intended as an improvement for people like myself who followed, who had nothing to go on. I apologize that I had assumed a familiarity with Xen CLI, what @mborodin wrote pretty much covers the bases there.

In turn, you have actually found 100% of the issues with that code snippet, so if it's any consolation, this should be enough to get you going!