Created
November 7, 2018 10:58
-
-
Save mfojtik/e8289033a67215a2bc34830e494b3907 to your computer and use it in GitHub Desktop.
POC: Run RHCOS via xhyve on OSX with ignition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # These have to be extracted from the qcow2 image | |
| # TODO: Provide these via docker image? | |
| KERNEL="vmlinuz-3.10.0-862.14.4.el7.x86_64" | |
| INITRD="initramfs-3.10.0-862.14.4.el7.x86_64.img" | |
| # This is where the magic happens | |
| # | |
| # To change the ignition (node type), you can use 'bootstrap', 'master' or 'worker' | |
| # coreos.config.url=http://192.168.0.168:8080/bootstrap.ign | |
| # | |
| # You can generate the .ign files using: openshift-install create ignition-configs --dir=/tmp/cluster-ignition | |
| # Then you can run simple HTTP server to serve them: | |
| # $ cd /tmp/cluster-ignition && python -m SimpleHTTPServer 8080 | |
| # | |
| # NOTE: Change the IP address to your Mac IP address? | |
| # | |
| # This is needed to run ignition on first boot to fetch the .ign files: | |
| # coreos.first_boot=detected | |
| # | |
| CMDLINE="earlyprintk=serial no_timer_check console=ttyS0 acpi=off root=/dev/vda1 root=UUID=75616629-8d7a-4a1d-93bc-47af28547d57 net.ifnames=0 biosdevname=0 rd.neednet=1 ip=eth0:dhcp ostree=/ostree/boot.0/rhcos/a381c1c06a830fa21f4ca0566064f141d5afdb11f2b94c93cef7845e37984238/0 rw coreos.config.url=http://192.168.0.168:8080/bootstrap.ign coreos.first_boot=detected" | |
| # To get qcow support you need hyperkit from Docker that has some experimental patches. | |
| # However, running bootkube on this setup will likely give you kernel panic, so I recommend to convert | |
| # the qcow to 'raw' format and use the official latest 'xhyve' binary? | |
| IMG_HDD="-s 2,virtio-blk,file:///Users/mfojtik/test-installer/rhcos-qemu.qcow2,format=qcow" | |
| # UUID makes the DHCP server give this VM the same IP address. If you run multiple VM's you probably want to | |
| # adjust this and store somewhere? | |
| UUID="-U 8e7af180-c54d-4aa2-9bef-59d94a1ac572" | |
| # VM config, nothing interesting here | |
| MEM="-m 4G" | |
| NET="-s 3:0,virtio-net,en0" | |
| PCI_DEV="-s 0:0,hostbridge -s 31,lpc" | |
| LPC_DEV="-l com1,stdio" | |
| ACPI="-A" | |
| # TODO: Use xhyve instead of hyperkit unless we want to deal with weird kernel panics ;) | |
| # | |
| sudo hyperkit $UUID $ACPI $MEM $PCI_DEV $LPC_DEV $NET $IMG_CD $IMG_HDD -f kexec,$KERNEL,$INITRD,"$CMDLINE" |
https://gist.github.com/praveenkumar/17e481780ba3506d949346d124214827 Here is the detail about how to get those vmlinuz and initrd files.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@mfojtik how did you extracted the
vmlinuzandinitrdfile from qcow2. I tried something following but didn't work well :( .sha256is not as it should be but I didn't get any error during downloading the image also.