Richard Bucker

Fedora 21 - Cloud

Posted at — Feb 23, 2015

The Project Atomic documentation is pretty clear but I had a number of challenges when deploying both Fedora-21 Cloud-Base and Fedora-31 Cloud-Atomic on my vagrant installation on OSX.First download the files. Notice that the files are .raw.xz files which means that the files are compressed raw. So they need to be unzipped first:xz -d Fedora-Cloud-Base-20141203-21.x86_64.raw.xzThis command is going to replace the file with an uncompressed version of the file and it will be a raw type.Now you have to convert the file from raw format to VDI for virtualbox:VBoxManage convertdd Fedora-Cloud-Base-20141203-21.x86_64.raw Fedora-Cloud-Base-20141203-21.x86_64.vdi –format VDII coped the resulting VDI file to my virtualvm folder but you can always deploy it from wherever you are. Note that this image is NOT an ISO so there is nothing to install. It’s already in a base configuration. This also means that the default user account has not had it’s password set so you will need to do that!!!The next step is to the virtualbox instance. You’ll need a little virtualbox experience to know how to mount the drive you just converted. The GUI makes it easy but I’m certain the same can be performed from the command line.Before launching / starting the instance you’ll need to create an init.iso.  This ISO image contains the necessary cloud-init files that define some basic info. In the real world you’ll need some real data for your environment but this is the starting point according to the docs.create a folder: configcreate a file: config/meta-datacreate a file: config/user-dataThe meta-data file:instance-id: Atomic01local-hostname: atomic-host-001The user-data file:#cloud-configpassword: redhatchpasswd: { expire: False }ssh_pwauth: Truessh_authorized_keys:   - … ssh-rsa new public key here user@host …Now you need to create the init.iso file.hdiutil makehybrid -o init.iso -hfs -joliet -iso -default-volume-name cidata config/Finally, going back to the virtualbox GUI you’ll need to add the drive to the instance configuration. And then you can start the image. Once the login prompt is displayed you can put the keyboard focus on the screen by clicking.  The default username is ‘fedora’ and the password is what you set it to.Here are a few notes:If you need to change any of the config information you’ll need to change the instance-id in the meta-data file. This is the only way to signal to the host OS that there was a change. If you do not change it then your changes will not take effect.  (this happened to me and it took hours to determine).If you want to ssh into the box then (a) you need to determine the IP address by logging into the box. There are a few virtualbox commands you can execute to locate the IP but that’s another topic. (b) before starting the OS instance you need to enable a second adapter host-only vboxnet0. This will create a local connection between the host and the guest instance.I have yet to determine the difference between the base and the atomic versions of the cloud image other than their size and docker is not available on the base. I’m certain there are also some reasons to confider the difference between the server and base versions. All are topics for another conversation.