nanovms / ops

ops - build and run nanos unikernels
https://ops.city
MIT License
1.27k stars 132 forks source link

Error "No bootable device" when starting image via Proxmox #1335

Closed fl0wm0ti0n closed 2 years ago

fl0wm0ti0n commented 2 years ago

Hello Guys!

OPS: Latest WSL2: Debian GNU/Linux 11 (bullseye)

issue: I made following c++ example via VS image

i built it via WSL2 CMAKE image

then i successfully run "ops run CMake-WSL2-TestProjekt" means i got my output i expected

after that i run ops build CMake-WSL2-TestProjekt Output: Bootable image file:/home/flow/.ops/images/CMake-WSL2-TestProjekt.img

then i started a VM in proxmox with this Image and i get an error "no bootable device" image

VM Settings: image image

Thank you for any help!

eyberg commented 2 years ago

@fl0wm0ti0n were you using 'ops image create -t proxmox' and 'ops instance create' to boot this? there are a few things that happen such as setting this as a virtio disk and setting the boot order

this isn't supposed to be booted from cd - if you didn't use image/instance create commands before can you try and see if that fixes your issue? you check out some examples here: https://docs.ops.city/ops/proxmox .

fl0wm0ti0n commented 2 years ago

@fl0wm0ti0n were you using 'ops image create -t proxmox' and 'ops instance create' to boot this? there are a few things that happen such as setting this as a virtio disk and setting the boot order

this isn't supposed to be booted from cd - if you didn't use image/instance create commands before can you try and see if that fixes your issue? you check out some examples here: https://docs.ops.city/ops/proxmox .

im sorry i dont get it ... i didt do the Proxmox steps you asked about.

i develop on WSL2 debian i did built an image via "ops build CMake-WSL2-TestProjekt" and i got an image.

i dont get how these proxmox steps are made?

in proxmox i simply import an image from where i can boot a vm like from an USB-Key

for example where do i run this steps?: export API_URL="https://172.16.41.133:8006" export TOKEN_ID="myuser@pam!tokenid" export SECRET="some-uuid-goes-here" ops image create g -t proxmox -c config.json

im not on proxmox bash, im on WSL2 Debian.

What is in the "config.json"? this isnt well described. and API Token Stuff i cant find under datacenter - there is no point for that in PROXMOX GUI.

Thanks alot

fl0wm0ti0n commented 2 years ago

isnt this api just to remotely work with proxmox? but i just want to boot my image like with a normal bare metal.

eyberg commented 2 years ago

ops works fine under WSL2 so you can do that

the config.json is just a configuration file (if you need extra config) - it's not mandatory

what 'ops image create' does is create a disk for you to boot from - you're choosing a bootable cdrom and that's why it isn't working for you

if you want to do this manually (not advised) - you'll need to create a disk out of the image and set the boot to boot from that - not the cdrom https://github.com/nanovms/ops/blob/master/proxmox/proxmox_instance.go#L102-L103

you can create a token to access the API like so: https://pve.proxmox.com/wiki/Proxmox_VE_API

fl0wm0ti0n commented 2 years ago

Thank you very much for your replies!

that leads to further questions :D proxmox is for me just a easy option to test machines. My target is to boot my C++ App bare metal via USB-Key. As i understand booting with USB-Key isnt possible at all? i thought id doesnt matter if USB or Built in Disk as far at it is a bootable media.

if you want to do this manually (not advised) - you'll need to create a disk out of the image and set the boot to boot from >that - not the cdrom https://github.com/nanovms/ops/blob/master/proxmox/proxmox_instance.go#L102-L103

How to make a real bare metal disk out of this kind of image?

i read this https://docs.ops.city/ops/bare_metal so it should boot bare metal i think. but in this article there isnt described how i get the image on to a harddisk for example or on to a USB-Key.

Do you have any idea how to to boot via USB? i mean if bare metal works i could do a magic that the usb key get recognized as Disk.

Thanks alot

eyberg commented 2 years ago

No we only support virtual disks and have no plans on supporting different devices.

To clarify that page you are referencing (bare metal) that page is saying that you can run ops on a real machine (versus uploading images to a public cloud) but ops spins up virtual machines under qemu. There is never a case where we would flash an actual physical machine with the disk image. All Nanos workloads are meant to be ran virtualized - it is one of the key differences when compared to Linux which can be installed to actual metal.

fl0wm0ti0n commented 2 years ago

oh damn :( then i miss understood the Wiki completely...

i was searching a unikernel-solution where i can boot on bare metal.

maybe i can convert these VM image to a usable disk with some tools outhere I have found something: https://www.ubackup.com/enterprise-backup/vm-to-iso.html

  1. Install and put both dd and qemu-img program in the system path. Open a Command Prompt window in the folder where the source VMDK file is, and run the following commands to convert the source VMDK file to raw image. qemu-img convert -f vmdk filename.vmdk filename.raw

  2. And then run the following command to convert the raw image to ISO file. dd if=filename.raw of=filename.iso

is ops image a vmdk filetype?

Supported formats to convert: blkdebug blklogwrites blkverify bochs cloop compress copy-on-read dmg file ftp ftps gluster host_cdrom host_device http https iscsi iser luks nbd nfs null-aio null-co nvme qcow qcow2 qed quorum raw rbd replication ssh throttle vdi vhdx vmdk vpc vvfat

Edit: ah ok i see its raw:

flow@lightmachine:~/.ops/images$ qemu-img info CMake-WSL2-TestProjekt.img
image: CMake-WSL2-TestProjekt.img
file format: raw
virtual size: 17.9 MiB (18753024 bytes)
disk size: 7.91 MiB

Converted it, lets see:

flow@lightmachine:~/.ops/images$ dd if=CMake-WSL2-TestProjekt.img of=CMake-WSL2-TestProjekt.iso
36627+0 records in
36627+0 records out
18753024 bytes (19 MB, 18 MiB) copied, 0.0677159 s, 277 MB/s

Edit: ok as i thought that doesnt help... it needs someting that says "hey look here you can boot"

eyberg commented 2 years ago

to clarify we support many different filetypes and block devices but it's always going to run on a hypervisor/cloud of some kind - if your intention is that you want something to boot up on an actual real physical machine and overtake everything that's not a goal for this project - there are other projects like https://github.com/usbarmory/tamago though that do that

fl0wm0ti0n commented 2 years ago

okey, thank you very much for the informations, i search something for x86_64 and c++ but this project is a good hint