using configuration from cloud-config file - I don't understand the documentation

166 views
Skip to first unread message

Frohike Mail

unread,
Apr 22, 2017, 4:41:46 AM4/22/17
to CoreOS User
Hi,

I am trying to setup a CoreOS node with libvirt on my bare metal server.

I am reading this:



The point where I get stuck is here:

I suddenly see a weird directory here? 

Now create a config drive file system to configure Container Linux itself:

mkdir -p /var/lib/libvirt/images/coreos/coreos1/openstack/latest
touch /var/lib/libvirt/images/coreos/coreos1/openstack/latest/user_data


why openstack/latest?  Is this an error?

Then it suddenly talks, for the SELinux adjustments, about a configdrive directory?

If the host uses SELinux, allow the VM access to the config:

semanage fcontext -a -t virt_content_t "/var/lib/libvirt/images/coreos0/configdrive(/.*)?"
restorecon -R "/var/lib/libvirt/images/coreos0/configdrive"

Further more, when I create the user_data file, with the alterations I need, where is this file provided in the virt-install command here:



virt-install --connect qemu:///system --import --name coreos1 --ram 1024 --vcpus 1 --os-type=linux --os-variant=virtio26 --disk path=/var/lib/libvirt/images/coreos/coreos1.qcow2,format=qcow2,bus=virtio --filesystem /var/lib/libvirt/images/coreos/coreos1/,config-2,type=mount,mode=squash --network bridge=virbr0,mac=52:54:00:fe:b3:c0,type=bridge --vnc --noautoconsole

I am suspecting the config-2 has something to do with it? I would expect a reference to the user_data file somewhere though.

Who can help clarify this up? And if there are errors in the documentation, it should be fixed I would say.

Rob Szumski

unread,
Apr 24, 2017, 1:37:14 PM4/24/17
to Frohike Mail, CoreOS User
Container Linux has a concept of OEMs, which indicate a few details about the platform and where to fetch configuration from. In this case, it looks like the image used by libvirt utilizes the Openstack OEM, which is why you see references to that.

I didn’t follow the exact error that you encountered. Was the configdrive mounted correctly within the image? Did it boot?

 - Rob

--
You received this message because you are subscribed to the Google Groups "CoreOS User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coreos-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Frohike Mail

unread,
Apr 24, 2017, 4:34:12 PM4/24/17
to CoreOS User, frohi...@gmail.com
Hi Rob,

Thank you for answering. OEM's, what do you mean by OEMs in this context?

This is the error I get:

[root@CentOS-73-64-minimal ~]# virt-install --connect qemu:///system --import --name coreos_provision01 --ram 8000 --vcpus 1      --os-type linux --os-variant virtio26 --disk path=/var/lib/libvirt/images/coreos/coreos_provision01.qcow2,format=qcow2,bus=virtio     --filesystem /var/lib/libvirt/images/coreos/coreos_provision01/,config-2,type=mount,mode=squash --network bridge=virbr0, --graphics vnc,listen=0.0.0.0         --hvm          --noautoconsole


Starting install...

ERROR    internal error: process exited while connecting to monitor: s=pci.0,multifunction=on,addr=0x6 -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x6.0x1 -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x6.0x2 -drive file=/var/lib/libvirt/images/coreos/coreos_provision01.qcow2,format=qcow2,if=none,id=drive-virtio-disk0 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -fsdev local,security_model=none,id=fsdev-fs0,path=/var/lib/libvirt/images/coreos/coreos_provision01/ -device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=config-2,bus=pci.0,addr=0x3 -netdev tap,fd=27,id=hostnet0,vhost=on,vhostfd=29 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:20:d2:c2,bus=pci.0,addr=0x4 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -vnc 0.0.0.0:1 -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7 -msg timestamp=on

2017-04-24T20:14:05.505287Z qemu-kvm: -device virtio-9p-pci,id=fs0,fsdev=fsde

Domain installation does not appear to have been successful.

If it was, you can restart your domain by running:

  virsh --connect qemu:///system start coreos_provision01

otherwise, please restart your installation.



Op maandag 24 april 2017 19:37:14 UTC+2 schreef Rob Szumski:

Alex Crawford

unread,
Apr 24, 2017, 5:01:14 PM4/24/17
to Frohike Mail, CoreOS User
On 04/24, Frohike Mail wrote:
> Thank you for answering. OEM's, what do you mean by OEMs in this context?

Rob is referring to the different flavors of Container Linux that we
build. We have small customizations depending on where the image will be
run. For example, AWS has a slightly different setup than GCE or Azure.

That being said, the doc you are following still mentions these
configdrive paths. The reason those are still mentioned are because they
are a carry-over from an older provisioning setup. Since these docs are
maintained by the community, we haven't had a chance to go in and update
them. Now seems as good a time as any to get those straightened out...

I would recommend you use Ignition instead to provision your machine.
This config is passed to QEMU via the firmware configuration device at
'opt/com.coreos/config'. An example of this can be found here:

https://github.com/dghubble/coreloko/blob/master/coreloko

For an overview of Ignition and provisioning Container Linux, check out:

https://coreos.com/os/docs/latest/provisioning.html

-Alex
signature.asc

Frohike Mail

unread,
Apr 24, 2017, 6:04:09 PM4/24/17
to CoreOS User, frohi...@gmail.com
Hi, thank you very much for clarification. Yeah, I did find Coreloko, but I did not know how to use it. 

That link, is a script for coreloko. Can you lead me a bit here, how can I use that? Copy it and run it as a file on my bare metal server ? 




Op maandag 24 april 2017 23:01:14 UTC+2 schreef Alex Crawford:

Euan Kemp

unread,
Apr 24, 2017, 6:38:13 PM4/24/17
to coreo...@googlegroups.com
I believe Crawford was specifically pointing to the snippet
https://github.com/dghubble/coreloko/blob/b1251327845c8c01e3ad1014bfcd02cb8899abcd/coreloko#L116-L129
as an example of how to use the qemu-cmdline parameters.


The snippet of code I use to use libvirt + ignition together is a little
clearer I think:
https://gist.github.com/euank/7c030ce123fc35d71361c25b69abe3d0


Using that on a given libvirt xml domain (e.g. as gotten via
virt-install --print-xml) will add the ignition parameter.


Best,
Euan
> <https://coreos.com/os/docs/latest/provisioning.html>
>
> -Alex
>
> --
> You received this message because you are subscribed to the Google
> Groups "CoreOS User" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to coreos-user...@googlegroups.com
> <mailto:coreos-user...@googlegroups.com>.
signature.asc

Frohike Mail

unread,
Apr 25, 2017, 7:05:36 AM4/25/17
to CoreOS User
Yes, I have thought of that, but I stumbled on this problem, which is quite recent:

The guy says first qemu needs to be upgraded.

I also see there is a qemu-kvm, and qemu is not installed on CentOS. 

Can someone tell me how to use your snippet, and coreloko in an example? I really don't get it I'm afraid. I'm pretty new to libvirt, QEMU and CoreOS



Op dinsdag 25 april 2017 00:38:13 UTC+2 schreef Euan Kemp:
Reply all
Reply to author
Forward
0 new messages