AlexW
(Alex W)
July 24, 2018, 9:15pm
1
Hello,
Would anybody know what do I have to do so after instantiating a container its name matches the OS host name?
Right now, I have something like:
Container name: “one-514”
OS hostname: “lxdtest000”
And I’d like to have something like:
Container name: “lxdtest000”
OS hostname: “lxdtest000”
By the way, this for OpenNebula 5.4.6/LXDoNe 5.4-5/LXD 2.0.11 running on Ubuntu 16.04.
Thanks a lot,
Alex
dclavijo
(Daniel Clavijo)
July 24, 2018, 9:57pm
2
You might wnat to read this
https://lxd.readthedocs.io/en/latest/image-handling/#content
You can control the content of files inside the container through its metadata. For example,
"{{ config_get("user.hostname", "lxdone")}}"
in the templates/hostname.tpl
file would name the container lxdone always
AlexW
(Alex W)
July 25, 2018, 8:54pm
3
Hi Daniel,
Thanks!
And sorry for not being clearer on my post…: I was thinking about something that could possibly be configured at OpenNebula’s VM template level.
It seams that by default the container, at LXD level, is named by using OpenNebula’s “DEPLOY_ID” variable. I’d like to change that, so the container’s name would be set by using OpenNebula’s “NAME” variable.
Regards,
Alex
dclavijo
(Daniel Clavijo)
July 25, 2018, 9:00pm
4
Oh, maybe you should rename the title to something oriented to VM naming in OpenNebula, so people don’t skip it when they see LXDoNe.
Maybe something from this could be helpful
http://docs.opennebula.org/5.6/operation/vm_management/vm_instances.html
http://docs.opennebula.org/5.6/operation/vm_management/vm_templates.html
AlexW
(Alex W)
July 25, 2018, 9:59pm
5
Hi Daniel,
OK, I’ll take a look at that. Thanks a lot…!
Regards,
Alex