vms/README.md

82 lines
2.2 KiB
Markdown
Raw Normal View History

2022-11-02 10:52:10 +01:00
# vms
2022-12-06 15:44:25 +01:00
Virtual machine image builder (based on EOLE3 builder)
## What do we have here ?
### The "build" tool
This is a simple wrapper to help you build and publish images with "packer" and "one-templates"
### The "publisher" tool called "tools/one-templates"
2023-02-08 12:01:09 +01:00
This is a simple script to create and manage OpenNebula "Templates", all kinds of templates:
2022-12-06 15:44:25 +01:00
* VMs
* Networks
* Images
* Services
With this tool you can publish all the images and the necessary templates to actually use what you build in OpenNebula.
## What you need ?
* Packer >= 1.6.0
* virt-sparsify (optional)
* Ruby
2023-02-08 12:01:09 +01:00
* These ruby gems:
2022-12-06 15:44:25 +01:00
* opennebula
* opennebula-cli
* opennebula-oca
* webrick
* An OpenNebula server or cluster >= 5.6 (with OpenNebula Flow and OneGate enabled)
2023-02-08 12:01:09 +01:00
* An account with the proper ACL on the OpenNebula server/cluster to:
2022-12-06 15:44:25 +01:00
* create/manage images
* create/manage vm templates
* create/manage services templates
* create/manage network templates
## How to use the "build" tool ?
First you need to create the "publisher" "tools/one-templates" configuration.
2023-02-08 12:01:09 +01:00
This configuration is located in "./tools/.one-templates.conf".
Note that you can use a different configuration file setting the TEMPLATER_CONFIG environment file before starting the build script.
2022-12-06 15:44:25 +01:00
```
$ cat ./tools/one-templates.conf
user: myOpenNebulaUser
token: myVerySecretOpenNebulaTemporaryToken
2023-02-08 12:01:09 +01:00
builder_addr: IP Address of the building machine (often your own local IP address)
2022-12-06 15:44:25 +01:00
endpoint: http://myOpenNebulaServerAddress...
flow_endpoint: http://myOpenNEbulaServerAddress/oneflow
datastore_id: TheDataStoreIDForMyImages
```
When this configuration is done you can use the "build" tool.
2023-02-08 12:01:09 +01:00
The recipes are organised by OS, version and flavor, one OS contains various versions and flavors.
You can list the available OS and versions with this command:
2022-12-06 15:44:25 +01:00
```
$ ./build list
2023-02-08 12:01:09 +01:00
You can build :
2022-12-06 15:44:25 +01:00
* alpine :
- 3.16
```
2023-02-08 12:01:09 +01:00
To build all the flavors of a version you can run this command:
2022-12-06 15:44:25 +01:00
```
$ ./build start alpine 3.16
```
2023-02-08 12:01:09 +01:00
To build only one flavor for one version you can run this command:
2022-12-06 15:44:25 +01:00
```
$ ./build run alpine 3.16 k3s
```
2023-02-08 12:01:09 +01:00
`!!! Make sure the "base" flavor is build before trying to build another flavor. !!!`
2022-12-06 15:44:25 +01:00
```
$ ./build run alpine 3.16 base
```