new os-interface 'convert qcow2 to rwa'

37 views
Skip to first unread message

Ansgar Jazdzewski

unread,
Jun 21, 2019, 3:52:55 AM6/21/19
to Ganeti
hi folks,

we are thinking about to write a new os-interface it sould be able to
install openstack-images and run cloud-init

we are in a brainstrome mod in the moment !!!

- get the img and write it to the device an be done like: $ qemu-img
convert -p -f qcow2
https://cdimage.debian.org/cdimage/openstack/9.9.3-20190618/debian-9.9.3-20190618-openstack-amd64.qcow2
local.raw
- add access to the metad: use QEMU User Networking (SLIRP)

if you can provide some more thoughts, feel free to join into the brainstorm.

Cheers,
Ansgar

Petter Urkedal

unread,
Jun 25, 2019, 12:49:17 PM6/25/19
to 'Ansgar Jazdzewski' via ganeti
Here are my findings on the metad:

In order for the metad to start, one needs to add a network interface to
the instance with

name=ganeti:communication:...,mode=routed,ip=...

That makes the metadata service available from the Ganeti node, but not
immediately from the VM. According to the documentation cloud-init VM
will only start the first network interface. I am not sure what the
intended setup is for the Ganeti communication device, whether it should
live beside the regular device and be removed after cloud-init. It is
possible to do a custom setup on the VM side by adding a
cloud-init-local.service to the image.

On a second note, the Ganeti metad has it's own conventions for the REST
API. To use it, we can create a data source for Ganeti [2], and patch
cloud images until we get it into a distribution. Or, we would extend
metad to support/fake a popular cloud provider.

[1]: https://cloudinit.readthedocs.io/en/latest/topics/boot.html#local
[2]: https://cloudinit.readthedocs.io/en/latest/topics/datasources.html

candlerb

unread,
Jun 25, 2019, 4:43:04 PM6/25/19
to ganeti
I made some notes trying out the metadata service here:

I got to the point where I could access it over the private 169.254 link, but as you discovered, it's not compatible with regular cloud providers, so would require either hacking the metad or cloud-init.

Petter Urkedal

unread,
Jun 26, 2019, 4:11:55 AM6/26/19
to gan...@googlegroups.com
Could the VM access it? I could access it from the Ganeti host, but I
had to configure the link manually from within the VM, so cloud-init
didn't even try on boot.

Some data sources, including OpenStack, use detection before they try to
request data [1]. We can still use them with tweaks.

[1]: https://cloudinit.readthedocs.io/en/latest/topics/datasources/openstack.html

Ansgar Jazdzewski

unread,
Jun 26, 2019, 4:19:55 AM6/26/19
to Ganeti
i got the metad running and also got to the point: how can I serve the
cloud-init-file!?

found also some existing os-providers
* https://github.com/osuosl/ganeti-instance-image
- deploy images
* https://github.com/pdxcat/ganeti_cloud-init
- use NoCloud to create a disk with a clouinit file

i hope i can somehow add a rest-endpoint for the clout-init
> --
> You received this message because you are subscribed to the Google Groups "ganeti" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ganeti+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ganeti/072dbec4-4b43-4660-a632-bb7b1954148a%40googlegroups.com.

Ansgar Jazdzewski

unread,
Jun 26, 2019, 6:09:12 AM6/26/19
to Ganeti
i mad some progress, i can access metadata from inside the instance

on the node:
# gnt-os info image
image:
- valid: True
- hidden: False
- blacklisted: False
- API versions:
- 5
- 10
- 15
- 20
- variants:
- default
- parameters:
- cloud_init: contetn of cloud_init
- trusted: True

# gnt-instance modify -o image+default -O cloud_init="{foo: bar}" test
Modified instance test
- os/cloud_init -> {foo: bar}

from the instance:
# wget -qO- http://169.254.169.254/ganeti/latest/os/parameters.json
{"cloud_init":["{foo: bar}","public"]}



Am Mi., 26. Juni 2019 um 10:19 Uhr schrieb Ansgar Jazdzewski
<a.jazd...@googlemail.com>:

Petter Urkedal

unread,
Aug 1, 2019, 5:40:10 AM8/1/19
to 'Ansgar Jazdzewski' via ganeti
Hi,

I created a cloud-init based OS definition which can be found at
https://github.com/neicnordic/ganeti-os-nocloud. This is a rather
mundane solution, as it skips metad, injecting meta-data into the file
system instead. On the plus side that means there is no need to arrange
an additional network device during the first boot. Maybe not the final
solution, but it's working.

Petter
Reply all
Reply to author
Forward
0 new messages