Skip to content

providers/qemu: support Ignition block device on all arches - #999

Closed
jlebon wants to merge 1 commit into
coreos:mainfrom
jlebon:pr/blockdev-all-arches
Closed

jlebon wants to merge 1 commit into
coreos:mainfrom
jlebon:pr/blockdev-all-arches

Conversation

@jlebon

@jlebon jlebon commented Jun 11, 2020

Copy link
Copy Markdown
Member

We've had some good success with the new block device approach on s390x
and ppc64le. Let's now make it available on all arches. This is the
first step towards eventually deprecating fw_cfg:

#928 (comment)

Early adopters will benefit from simplified code which works across all
architectures, as well as better compatibility with other virtualization
tooling like libvirt, which today doesn't expose fw_cfg easily (though
there's work in flight for that).

We've had some good success with the new block device approach on s390x
and ppc64le. Let's now make it available on all arches. This is the
first step towards eventually deprecating `fw_cfg`:

coreos#928 (comment)

Early adopters will benefit from simplified code which works across all
architectures, as well as better compatibility with other virtualization
tooling like libvirt, which today doesn't expose `fw_cfg` easily (though
there's work in flight for that).
@jlebon

jlebon commented Jun 11, 2020

Copy link
Copy Markdown
Member Author

@Prashanth684 Could you sanity-check this on s390x or ppc64le?

@cgwalters cgwalters left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks sane to me!

@Prashanth684

Copy link
Copy Markdown
Contributor

@Prashanth684 Could you sanity-check this on s390x or ppc64le?

yes...will try this out and let you know.

@Prashanth684

Copy link
Copy Markdown
Contributor

lgtm on s390x/ppc64le

@arithx arithx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code changes LGTM, worth noting that it does add a potential 5 minute timeout for fw_cfg supported systems that don't provide an Ignition config but given we're moving in the direction of block devices I think it's a trade off we just have to accept.

@jlebon

jlebon commented Jun 16, 2020

Copy link
Copy Markdown
Member Author

Code changes LGTM, worth noting that it does add a potential 5 minute timeout for fw_cfg supported systems that don't provide an Ignition config

Just to clarify, in this model, you have to provide a block device. The 5 minute timeout is an error condition, not a "nothing was provided, so continue". See #928 for lots more discussions on this. (That said, you actually can provide a zero-sized block device if you really want to skip providing an Ignition config on QEMU for whatever reason.)

@crawford

Copy link
Copy Markdown
Contributor

I still have the concern that I originally raised. This is a departure from Ignition's original vision and I think this is ultimately going to negatively impact the project. I'd rather we look into different approaches to this problem.

@bgilbert bgilbert left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I won't block this, but I agree with @crawford's concerns.

@@ -42,7 +37,19 @@ const (
)

func FetchConfig(f *resource.Fetcher) (types.Config, report.Report, error) {
f.Logger.Warning("Fetching the Ignition config via the Virtio block driver is currently experimental and subject to change.")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are we ready to mark this not-experimental? Without some field experience, I'm not 100% convinced that requiring an Ignition config is viable.

@jlebon
jlebon marked this pull request as draft June 19, 2020 13:13
@jlebon

jlebon commented Jun 19, 2020

Copy link
Copy Markdown
Member Author

Converted back to a draft until we get consensus.

@jlebon

jlebon commented Jun 19, 2020

Copy link
Copy Markdown
Member Author

I still have the concern that I originally raised. This is a departure from Ignition's original vision and I think this is ultimately going to negatively impact the project. I'd rather we look into different approaches to this problem.

I wish there was a simpler/cleaner approach, I really do.

Addressing the comment you linked to:

I don't like the idea of always requiring an Ignition config because that immediately rules out using an OS with Ignition for hardware discovery (which is a very important aspect of bare metal provisioning).

To re-iterate, this is only affecting QEMU. For hardware discovery/bare metal provisioning, we have live media available which is fully capable of booting without an Ignition config (that's the metal platform).

Also, as I mentioned in this comment, strictly speaking this doesn't make the Ignition config required, it just makes the medium required. It's analogous to requiring the CD-ROM drive, but not requiring a CD inside.

Why I think this is reasonable is that IMO on QEMU not passing an Ignition config is likely much less common than passing one. E.g. for RHCOS/FCOS, there is no other way to provision a QEMU instance using the vanilla images. (So one upside of this actually is that making it a hard error makes users know they didn't setup/launch their VM right). Note that e.g. baking the config into the image is still totally supported.

But still, more generally I'm sure there are use cases for booting the QEMU image without an Ignition config. If you really want to do this, you can: just pass an empty file (or even /dev/null works) as your block device. (Or you can just use the metal platform.)

Have we ruled out "fixing" QEMU? Most commercial hypervisors provide a host-guest bridge for passing data back and forth.

I think it's going to be a hard sell asking to add another mechanism for passing data back and forth given that there are plenty available already. It's just that none of them clearly fit our strict requirements (see the criteria listed in this comment).

Also thinking about how all this integrates at higher levels, whatever mechanism we land on, it would be helpful if things that wrap QEMU or libvirt already have bindings available for leveraging it. We have trouble enough with the fw_cfg approach (for example, it's only now that it's getting proper support in libvirt). Passing a block device is in general well-supported and given how generic it is, it could possibly be used even on other emulators (though to be fair, I'm not sure how many support setting the serial as well). Otherwise, we're going to need to drive that new mechanism everywhere as well.

@crawford

Copy link
Copy Markdown
Contributor

One of the original reasons we created Ignition was so that we didn't have to think about the differences between platforms - or at least to get a little closer to that goal. Having one platform behave fundamentally differently goes against that original vision. It was also structured to be reusable by other operating systems. That's why you won't find any sections in the config related to etcd, fleet, or anything specific to CoreOS Inc.. Even though we don't have a tremendous number of outside users, the benefits of sticking to these principles are hard to overstate. And as I hear about the growing number of OSs that Red Hat is planning on building and their various use cases, it's going to be crucial to our success to be able to re-use this component as much as desired. The more we make these small compromises for a short-term win, the harder we are going to make it for ourselves in the future.

@fabiand

fabiand commented Jul 8, 2020 •

Copy link
Copy Markdown

For QEMU, what about passing the data using 9p or virtiofs - for these the discovery should be easier, and we would not need to wait.

However, the implementation might be more difficult.

@cgwalters

Copy link
Copy Markdown
Member

One possibility is to also require some sort of "flag" to be passed to signal to find an Ignition config via virtio-blk. That could be a SMBIOS flag or really anything that can reliably carry a single bit from the host to the guest.

Having one platform behave fundamentally differently goes against that original vision.

Hmm...ultimately though how we acquire metadata already varies wildly across different platforms, because they're all different right?

It was also structured to be reusable by other operating systems. That's why you won't find any sections in the config related to etcd, fleet, or anything specific to CoreOS Inc..

That's not related to this is it? We're not changing anything around what's inside the config here. I think we all agree on having Ignition be generic.

@jlebon

jlebon commented Sep 7, 2023

Copy link
Copy Markdown
Member Author

It doesn't seem like there's a clear way forward here so I'll just close this.

@jlebon jlebon closed this Sep 7, 2023
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.

7 participants