Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add doc for booting in a VM #22

Merged
merged 5 commits into from
Jan 14, 2020
Merged

Add doc for booting in a VM #22

merged 5 commits into from
Jan 14, 2020

Conversation

adriannemora
Copy link
Contributor

This guide provides easy, step-by-step instructions to produce a basic Ignition file and use it to launch a Fedora CoreOS VM with QEMU.

@Conan-Kudo
Copy link

@adriannemora It looks like your Git configuration isn't set up correctly for automatically setting the correct authorship for commits.

In addition, while the pull request has a good title and description, the commit itself only says "WIP". It'd be great to have a proper title and commit description. Here's some good guidelines for commit messages.

The steps below will help you set things right:

$ cd /path/to/fedora-coreos-docs
$ git config --global user.name "Your Name"
$ git config --global user.email "yname@example.com"
$ git commit --amend --reset-author
$ git push --force

- Add new page for VM boot instructions.
- Link VM boot instructions page on the current "Getting started" page.
- Create new page for running containers, to be linked to from all other
  instructions.
- Add content from running-containers.adoc to fcct-config.adoc

- Modify getting-started.adoc to add instructions for launching VMs with QEMU

- Move instructions for producing Ignition files to a new page (producing-ign.adoc)

- Move sysctl.adoc content to fcct-config.adoc.

Edits:

- Add note about relative paths in QEMU section of getting-started.adoc based on Neal Gompa's advice.

- Multiple edits for organization, clarity, and conciseness.
modules/ROOT/pages/fcct-config.adoc Outdated Show resolved Hide resolved
modules/ROOT/pages/fcct-config.adoc Outdated Show resolved Hide resolved
modules/ROOT/pages/fcct-config.adoc Outdated Show resolved Hide resolved
modules/ROOT/pages/fcct-config.adoc Outdated Show resolved Hide resolved
modules/ROOT/pages/fcct-config.adoc Outdated Show resolved Hide resolved
modules/ROOT/pages/getting-started.adoc Outdated Show resolved Hide resolved
modules/ROOT/pages/producing-ign.adoc Outdated Show resolved Hide resolved
modules/ROOT/pages/getting-started.adoc Outdated Show resolved Hide resolved
modules/ROOT/pages/producing-ign.adoc Outdated Show resolved Hide resolved
modules/ROOT/pages/producing-ign.adoc Outdated Show resolved Hide resolved
@dustymabe
Copy link
Member

I just stumbled upon this. Thanks @adriannemora! Should I let you do another update before digging in?

@adriannemora
Copy link
Contributor Author

adriannemora commented Jan 9, 2020

@dustymabe I'm working on it now. By tomorrow, you can dive in to the next PR. Thank you!

Done:

- Restore running-containers.adoc and sysctl.adoc

- Minor edits to pages to wrap up this PR.

To do in future PRs:

- Expand fcct-config.adoc

- Show contents of example.ign in producing-ign.adoc

- Replace fcct binary instructions with containerized workflow in producing-ign.adoc
* Modify nav.adoc with new pages

* Add Ignition configuration pages

* Add instructions for a bare metal install.

* Add instructions for using fcct

* Edits for organization and consistency of formatting/language
. From the boot menu, press `<TAB>` (isolinux) or `e` (grub) to edit the kernel command line.
. Add the following parameters to the kernel command line:
* `coreos.inst.install_dev=/dev/sda`
* `coreos.inst.stream=testing`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably want to change this to stable

* `coreos.inst.install_dev=/dev/sda`
* `coreos.inst.stream=testing`
* `coreos.inst.ignition_url=http://example.com/config.ign`
* `coreos.inst.platform_id=qemu`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If users are truly installing to bare metal, I think this should be coreos.inst.platform_id=metal

If users are testing ISO install in a VM, then qemu should be used.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think both cases should be metal - qemu means that we're fetching Ignition from the fw_cfg, but we aren't doing that here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coreos.inst.platform_id is kind of an obscure option. Unless the user is running the installer to install into a VM, which is an unusual case, it's not needed at all.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bgilbert I.e. we should be able to drop this line entirely and let it default to metal, right?

PROMPT 0
LABEL pxeboot
KERNEL fedora-coreos-30.20191014.1-live-kernel-x86_64
APPEND ip=dhcp rd.neednet=1 initrd=fedora-coreos-30.20191014.1-live-initramfs.x86_64.img console=tty0 console=ttyS0 coreos.inst.install_dev=/dev/sda coreos.inst.stream=testing coreos.inst.ignition_url=http://192.168.1.101:8000/config.ign
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the stream to stable

Ignition configurations are formatted as JSON, which is quick and easy for a machine to read. However, these files are not easy for humans to read or write. The solution is a two-step configuration process that is friendly for both humans and machines:

. Produce a YAML-formatted Fedora CoreOS Configuration (FCC) file.
. Run the Fedora CoreOS Configuration Transpiler (`fcct`) to convert the YAML file into a JSON Ignition file.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe link to the fcct repo here?

https://github.com/coreos/fcct

@@ -0,0 +1,38 @@
:experimental:

= Fedora CoreOS Configuration Transpiler (`fcct`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or link to the fcct repo on this page somewhere?

https://github.com/coreos/fcct

Copy link
Member

@miabbott miabbott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an awesome improvement from where we were. Thank you so much @adriannemora for the hard work.

There are a few nits remaining, but I think overall this is good to go.

Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. A few comments!

* Reference pages
** xref:platforms.adoc[Platforms]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may have missed it, but why are we commenting this out?


. Download an ISO image from the https://getfedora.org/coreos/download/[FCOS download page].
+
NOTE: You can install in either legacy boot (BIOS) mode or in UEFI mode, regardless of what mode the OS will use once installed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this needs a bit of clarification. How about we move it under Burn the ISO to disk and boot it. and make it something like:

NOTE: You can install in either legacy boot (BIOS) mode or in UEFI mode. The bare metal disk images will appropriately handle either case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we'd need to change the NOTE in the PXE section as well. In that case maybe we change the NOTE and move it up to before the numbered list starts?


* `variant`: specifies `fcos` as the operating system
* `version`: specifies the version of `fcct`
* `ignition`: specifies a remote configuration (for convenience or for platforms that do not allow for the ingestion of large configuration files)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is slightly misleading. It's more than what you describe here. The spec just describes it as metadata about the configuration itself..

If we want to include more than just that then maybe we should make it something like metadata that tells ignition how to treat the data it has been given

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or maybe we just ignore the merging/replace bit and just say allows for specification of remote configuration files

@@ -0,0 +1,63 @@
:experimental:
= Ignition metadata (`ignition`)
The optional `ignition` block defines the metadata for the Ignition configuration. It allows you to specify a remote configuration file for platforms that do not allow the direct ingestion of large configuration files. It tells Ignition to start the first boot of FCOS, at which time, Ignition will fetch the specified Ignition file from a remote server.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are some clarifications that can be made here. Proposed update:

The optional ignition block defines the metadata for the Ignition configuration. It allows you to specify a remote Ignition configuration file that can either be merged into the existing Ignition configuration or be used to completely replace the existing Ignition configuration for first boot. Remote fetching of an Ignition configuration is useful as a convenience or for platforms that do not allow the direct ingestion of large configuration files. On the first boot of FCOS Ignition will fetch the specified Ignition file(s) from a remote server and merge or replace depending on the supplied directives.


include::ign-passwd.adoc[leveloffset=1]

// https://coreos.com/ignition/docs/latest/operator-notes.html
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

+
. Ensure the correct ownership of the file:
+
`chown core:kvm fedora-coreos-qemu.qcow2`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this really needed?


[Install]
WantedBy=multi-user.target
virt-install -n fcos --vcpus 2 -r 2048 --os-variant=fedora30 --import --network bridge=virbr0 --disk=/var/lib/libvirt/images/fedora-coreos-30.20190905.0-qemu.qcow2,format=qcow2,bus=virtio --noautoconsole --qemu-commandline="-fw_cfg name=opt/com.coreos/config,file=/path/to/example.ign"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we break this one up to multiple lines with \ like we did for the qemu invocation above?

Also if we add --graphics=none and remove --noautoconsole then you'll get given a serial console by virt-install and your comment about Once the VM has finished booting, its IP addresses will appear on the serial console will be more appropriate.

Note that when using docker instead of podman, units starting docker containers will need `Requires=docker.service` and `After=docker.service` to ensure the docker daemon is running before trying to start containers.

=== Running etcd
. You can then SSH into the FCOS VM as the `core` user:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to add "Assuming the provided Ignition config defined an SSH public key to be used for the core user, you can then..."


In order to temporarily boot into the previous OS deployment, hold down `Shift` during OS bootup and select the relevant OS entry in the bootloader menu.
The default boot configuration is not affected by this action, and the next reboot will select again the updated OS.
To temporarily boot the previous OS deployment, hold down `Shift` during the OS boot process. When the bootloader menus appears, select the relevant OS entry in the menu.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is Shift consistent? I think you can press any key (I usually use arrow keys) to interrupt grub. I'll check this in a bit

@dustymabe
Copy link
Member

Thanks @adriannemora - this is looking really good!

@@ -0,0 +1,53 @@
:experimental:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do these experimental markers mean? Is it e.g. some notice to say that FCOS is experimental? I think we can drop those now. :)

* `coreos.inst.install_dev=/dev/sda`
* `coreos.inst.stream=testing`
* `coreos.inst.ignition_url=http://example.com/config.ign`
* `coreos.inst.platform_id=qemu`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bgilbert I.e. we should be able to drop this line entirely and let it default to metal, right?

IPAPPEND 2
----

For more details on how to use this information, see the https://dustymabe.com/2019/01/04/easy-pxe-boot-testing-with-only-http-using-ipxe-and-libvirt/[instructions] for testing a PXE installation via a local VM and `libvirt`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "see this blog post" instead to make it clear it's an external website?


[Install]
WantedBy=multi-user.target
virt-install -n fcos --vcpus 2 -r 2048 --os-variant=fedora30 --import --network bridge=virbr0 --disk=/var/lib/libvirt/images/fedora-coreos-30.20190905.0-qemu.qcow2,format=qcow2,bus=virtio --noautoconsole --qemu-commandline="-fw_cfg name=opt/com.coreos/config,file=/path/to/example.ign"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, fedora31 should be a valid --os-variant value nowadays :)


The `systemd` node contains one top-level node: a list of units. For each unit, the following options are available:

* `name` (string, required, must be unique): the full name of the unit the form of `thing.service`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the form of?


TIP: YAML files must have consistent indentation. Although `fcct` checks for syntax errors, ensure that the indentation matches the above example. Overall, the FCC files must conform to ``fcct``'s xref:fcct-config.adoc[schema].

=== Using FCCT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this section seems redundant with using-fcct.adoc -- we can just link to that doc it seems?

@dustymabe
Copy link
Member

Should we "rebase and merge" this PR since it's a good start and address all code review comments in follow ups?

@adriannemora
Copy link
Contributor Author

adriannemora commented Jan 14, 2020 via email

@dustymabe dustymabe merged commit 6932463 into coreos:master Jan 14, 2020
dustymabe pushed a commit that referenced this pull request Jan 14, 2020
Done:

- Restore running-containers.adoc and sysctl.adoc

- Minor edits to pages to wrap up this PR.

To do in future PRs:

- Expand fcct-config.adoc

- Show contents of example.ign in producing-ign.adoc

- Replace fcct binary instructions with containerized workflow in producing-ign.adoc
@jlebon
Copy link
Member

jlebon commented Jan 14, 2020

Follow-ups in #25 and #26!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants