Skip to content

Add Ubuntu 18.04 QEMU image for Cluster API#169

Merged
k8s-ci-robot merged 1 commit intokubernetes-sigs:masterfrom
hidekazuna:qemu
Mar 24, 2020
Merged

Add Ubuntu 18.04 QEMU image for Cluster API#169
k8s-ci-robot merged 1 commit intokubernetes-sigs:masterfrom
hidekazuna:qemu

Conversation

@hidekazuna
Copy link
Contributor

@hidekazuna hidekazuna commented Feb 28, 2020

This PR adds Ubuntu 18.04 QEMU image for Cluster API.

Fixes #96

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 28, 2020
@k8s-ci-robot k8s-ci-robot requested review from detiber and ncdc February 28, 2020 07:28
Copy link
Contributor

@detiber detiber left a comment

Choose a reason for hiding this comment

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

Overall, these seems pretty reasonable. Can you add some documentation for this as well?

@hidekazuna hidekazuna force-pushed the qemu branch 2 times, most recently from 0a24b50 to a8325b7 Compare March 2, 2020 02:03
@hidekazuna
Copy link
Contributor Author

Overall, these seems pretty reasonable. Can you add some documentation for this as well?

Sure, I added docs/book/src/capi/providers/openstack.md.

Copy link
Member

@sbueringer sbueringer left a comment

Choose a reason for hiding this comment

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

@hidekazuna A lot of nitpicking I compared it with my version. I hope these are useful suggestions :)

@hidekazuna
Copy link
Contributor Author

@sbueringer All comments addressed. Thanks a lot!

Copy link
Member

@sbueringer sbueringer left a comment

Choose a reason for hiding this comment

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

Just a minor nit

@sbueringer
Copy link
Member

@detiber @ncdc I'm not a reviewer/approver in this repo. I know you're probably busy with the CAPI release, but can one of you please take a look at this PR and approve/lgtm it if looks good to you?

P.S. I rebased my own repo on top of this PR. And apart from some minor differences this should also verify that the build works: https://github.com/sbueringer/image-builder/runs/499696434?check_suite_focus=true

@sbueringer
Copy link
Member

@hidekazuna looks perfect now. Thx for working on this! :)

@moshloop
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 11, 2020
@detiber
Copy link
Contributor

detiber commented Mar 11, 2020

/approve

@sbueringer
Copy link
Member

@detiber @moshloop looks like lgtm and approve in this combination is not enough. Either moshloop has to approve or we have to find somebody else on the OWNERS file :)

@moshloop
Copy link
Contributor

@codenrhoden said he would have a quick look and approve this week still

@sbueringer
Copy link
Member

@codenrhoden said he would have a quick look and approve this week still

Okay perfect thx :)

@MnrGreg
Copy link
Contributor

MnrGreg commented Mar 12, 2020

@hidekazuna for info- if you're already using QEMU for the builder, you could also look at using qemu-img rather vmware-vdiskmanager to convert the VMDK to stream optimized and save a prep step for some.

        args = [
            'vmware-vdiskmanager',
            '-r', infile,
            '-t', '5',
            outfile
        ]

to:

        args = [
            'qemu-img',
            'convert',
            '-o',
            'compat6,subformat=streamOptimized',
            '-f',
            'qcow2',
            '-O',
            'vmdk',
            infile,
            outfile
        ]

@sbueringer
Copy link
Member

sbueringer commented Mar 12, 2020

@hidekazuna for info- if you're already using QEMU for the builder, you could also look at using qemu-img rather vmware-vdiskmanager to convert the VMDK to stream optimized and save a prep step for some.

        args = [
            'vmware-vdiskmanager',
            '-r', infile,
            '-t', '5',
            outfile
        ]

to:

        args = [
            'qemu-img',
            'convert',
            '-o',
            'compat6,subformat=streamOptimized',
            '-f',
            'qcow2',
            '-O',
            'vmdk',
            infile,
            outfile
        ]

@hidekazuna Similar if you want. There is also a command like this to create a vmdk

qemu-img convert -f qcow2 -O vmdk -o subformat=streamOptimized ${BUILD_DIR}/${IMAGE_NAME} ${BUILD_DIR}/${IMAGE_NAME}.vmdk
https://github.com/sbueringer/image-builder/blob/3ffaa62610d72e403d1a71d87d37030c984e30ab/images/capi/hack/image-build-vmdk-optimize-qcow2.sh

Not sure if that's wanted upstream but with one additional conversion we can create also a vmdk. In our use case we also need this (because we're using VMWare Integrated OpenStack which doesn't support qcow2), but for me it's okay to have this on a fork. But probably would be a nice feature for somebody.

@moshloop
Copy link
Contributor

Note that there are known issues when using qemu-img convert -f qcow2 -O vmdk on MacOSX - not sure if it applies to the stream optimization as well

https://bugs.launchpad.net/qemu/+bug/1776920

Copy link
Contributor

@codenrhoden codenrhoden left a comment

Choose a reason for hiding this comment

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

Hi @hidekazuna!

Thanks for putting this together. It looks really thorough. I just have a couple requests:

  • a header file that needs updating for copyright
  • removing capi_version from your packer.json

The rest are questions about whether we can symlink the preseed files instead of duplicating them, and a couple of other simple ones.

Thanks again!

state: link
when: ansible_os_family == "RedHat"

- name: Disable Hyper-V KVP protocol daemon on Ubuntu
Copy link
Contributor

Choose a reason for hiding this comment

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

I also meant to ask if this was something you wanted to keep. In the VMW provider, it made sense because it 1) worked around an Ubuntu kernel bug that made startup times increase by a bunch and 2) wasn't necessary since it would be running on an ESXi hypervisor rather than Hyper-V.

For a QEMU image, do you know that you'd never be running on Hyper-V?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for explaining why Hyper-V KVP protocol daemon is disabled. I am not sure QEMU image is "NEVER" used on Hyper-V, but typically if we want to use existing image, convert QEMU image to VHD and use it on Hyper-V.

@hidekazuna hidekazuna closed this Mar 12, 2020
@hidekazuna hidekazuna reopened this Mar 12, 2020
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 13, 2020
@hidekazuna hidekazuna requested a review from codenrhoden March 13, 2020 02:02
@sbueringer
Copy link
Member

@codenrhoden @hidekazuna Would be cool if could get this merged soon because I would like to refer to the qemu build in the ClusterAPI book: kubernetes-sigs/cluster-api#2683

Thx :)

@jichenjc
Copy link

@hidekazuna brand new to this , can you help on confirm that this will provide a way to build an image from somewhere (maybe iso or cloud image) into something can be used by cluster api e.g add openstack unique things along with kubeadm related stuffs so that we can use the image as glance source to boot from for controller pane and compute pane ? (I used to deploy a VM then install kubeadm manually and capture that image)

@sbueringer
Copy link
Member

sbueringer commented Mar 18, 2020

@hidekazuna brand new to this , can you help on confirm that this will provide a way to build an image from somewhere (maybe iso or cloud image) into something can be used by cluster api e.g add openstack unique things along with kubeadm related stuffs so that we can use the image as glance source to boot from for controller pane and compute pane ? (I used to deploy a VM then install kubeadm manually and capture that image)

@jichenjc
Our e2e conformance tests are currently using these images: https://github.com/sbueringer/image-builder/releases/tag/v1.17.3-04

(the version is more or less this PR + github actions build + ubuntu 1910)

The conformance tests are using a local devstack with kvm.

@hidekazuna
Copy link
Contributor Author

@hidekazuna brand new to this , can you help on confirm that this will provide a way to build an image from somewhere (maybe iso or cloud image) into something can be used by cluster api e.g add openstack unique things along with kubeadm related stuffs so that we can use the image as glance source to boot from for controller pane and compute pane ? (I used to deploy a VM then install kubeadm manually and capture that image)

@jichenjc Yes, you can use pre-kubeadm installed image for cluster-api-provider-openstack by this PR. No need to install kubeadm manually!

@hidekazuna
Copy link
Contributor Author

@moshloop @sbueringer Could you teach me what I have to address to merge this PR?

@sbueringer
Copy link
Member

@hidekazuna pr looks good to me. I'm just not a reviewer/approver in this repo 😅

@hidekazuna
Copy link
Contributor Author

@sbueringer Thanks for quick answer. kubernetes-sigs/cluster-api#2683 remains the link to this PR and has been merged so I wondered if something I have to fix.

@sbueringer
Copy link
Member

@hidekazuna nope everything alright. I just didn't want to wait with the Capo release. I'll update the link in the book after this pr is merged

@moshloop
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: detiber, hidekazuna, moshloop

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 24, 2020
@hidekazuna
Copy link
Contributor Author

@detiber @codenrhoden Could you please review this PR again and add lgtm label if you do not mind?

@moshloop
Copy link
Contributor

I think a /lgtm from @sbueringer should work as well

@sbueringer
Copy link
Member

/lgtm
let's see :)

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 24, 2020
@k8s-ci-robot k8s-ci-robot merged commit 6ceb75f into kubernetes-sigs:master Mar 24, 2020
@sbueringer
Copy link
Member

@moshloop So what are the requirements that a lgtm works? I though I have to be reviewer in the OWNERS file?

@moshloop
Copy link
Contributor

I think you only need to be a member of kubernetes-sigs for a lgtm - it might be different for k/k

@detiber
Copy link
Contributor

detiber commented Mar 24, 2020

@sbueringer: @moshloop is correct any member of kubernetes-sigs can lgtm, reviewers in owners files are automatically assigned to PRs for review. I believe it is possible to override the default policy, but we haven't seen a need for it as of yet.

@hidekazuna hidekazuna deleted the qemu branch March 24, 2020 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

images/capi/ova-ubuntu: cloud-init does not work in OpenStack

8 participants