Closed limegreendender2 closed 11 months ago
@limegreendender2 Hi, could you post the file content of /etc/firecracker/manifests/smoke-test.yml
on the machine?
And show the command result:
ctr --namespace firecracker container ls
ctr --namespace firecracker task ls
You can use ctr --namespace firecracker task attach ignite-xxxx
attach the vm as well.
There are some issues of ignite, this issue may cause by this one
apiVersion: ignite.weave.works/v1alpha4
kind: VM
metadata:
created: "2023-08-04T13:43:10Z"
name: smoke-test
uid: 0fd7d383-e547-4c59-918d-e238100f6ff6
spec:
cpus: 2
diskSize: 3GB
image:
oci: weaveworks/ignite-ubuntu:latest
kernel:
cmdLine: console=ttyS0 reboot=k panic=1 pci=off ip=dhcp
oci: weaveworks/ignite-kernel:5.10.51
memory: 800MB
network: {}
sandbox:
oci: weaveworks/ignite:v0.10.0
storage: {}
status:
idPrefix: ""
image:
id: null
size: 0B
kernel:
id: null
size: 0B
network:
ipAddresses: null
plugin: ""
running: true
runtime:
id: ""
name: ""
root@firecracker:~# ctr --namespace firecracker container ls
CONTAINER IMAGE RUNTIME
root@firecracker:~# ctr --namespace firecracker task ls
TASK PID STATUS
root@firecracker:~# ignite ps
VM ID IMAGE KERNEL SIZE CPUS MEMORY CREATED STATUS IPS PORTS NAME
0fd7d383-e547-4c59-918d-e238100f6ff6 weaveworks/ignite-ubuntu:latest weaveworks/ignite-kernel:5.10.51 3.0 GB 2 800.0 MB 3d18h ago Up <nil> smoke-test
root@firecracker:~# ps -aef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 Aug04 ? 00:00:01 /sbin/init
root 51 1 0 Aug04 ? 00:00:00 /lib/systemd/systemd-journald
systemd+ 65 1 0 Aug04 ? 00:00:00 /lib/systemd/systemd-networkd
root 90 1 0 Aug04 ? 00:00:00 /sbin/dhclient -4 -v -i -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases -I -df /var/lib/dhcp/dhclient6.eth0.leases eth0
root 91 1 0 Aug04 ? 00:00:00 /usr/sbin/cron -f
message+ 92 1 0 Aug04 ? 00:00:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
root 93 1 0 Aug04 ? 00:00:00 /usr/sbin/rsyslogd -n -iNONE
root 94 1 0 Aug04 ? 00:00:00 /lib/systemd/systemd-logind
systemd+ 102 1 0 Aug04 ? 00:00:00 /lib/systemd/systemd-resolved
root 147 1 0 Aug04 ? 00:04:46 /usr/bin/containerd
root 151 1 0 Aug04 pts/0 00:00:00 /sbin/agetty -o -p -- \u --noclear --keep-baud console 115200,38400,9600 linux
root 152 1 0 Aug04 pts/1 00:00:00 /bin/login -p --
root 153 1 0 Aug04 pts/2 00:00:00 /sbin/agetty -o -p -- \u --noclear --keep-baud tty2 115200,38400,9600 linux
root 315 1 0 Aug04 ? 00:00:00 /usr/lib/postfix/sbin/master -w
postfix 317 315 0 Aug04 ? 00:00:00 qmgr -l -t unix -u
root 445 152 0 Aug04 pts/1 00:00:00 -bash
root 1603 445 0 Aug04 pts/1 00:00:11 ignited daemon --log-level debug
postfix 3988 315 0 07:42 ? 00:00:00 pickup -l -t unix -u -c
root 4021 445 0 07:48 pts/1 00:00:00 ps -aef
root@firecracker:~# ^C
@limegreendender2 Hi, there actually some bugs with ignite rm
, i will fix that later, for now, you can clean the env and restart the vm:
pe -ef|grep ignited
to find the PID of ignited, and use kill
command to stop itignite vm stop ignite-xxx
and ignite vm rm ignite-xxx
the clean the ignite vmcd /etc/firecracker/manifests/
and rm smoke-test.yml
ignited daemon --log-level debug &
to restart the ignited daemonVMFILE=/etc/firecracker/manifests/smoke-test.yml
tee "$VMFILE" > /dev/null <<EOF
apiVersion: ignite.weave.works/v1alpha4
kind: VM
metadata:
name: smoke-test
uid: $(uuidgen)
spec:
image:
oci: weaveworks/ignite-ubuntu
cpus: 2
diskSize: 3GB
memory: 800MB
ssh:
generate: true
status:
running: true
EOF
And then run
ctr --namespace firecracker container ls
and ctr --namespace firecracker task ls
to check if the contianerd contaier been created.
root@firecracker:/etc/firecracker/manifests# ignite vm stop ignite-xxx a
FATA[0000] can't find VM: no ID/name matches for "ignite-xxx"
root@firecracker:/etc/firecracker/manifests# ignite vm stop smoke-test
FATA[0000] unknown runtime ""
root@firecracker:/etc/firecracker/manifests# ignite vm stop 0fd7d383-e547-4c59-918d-e238100f6ff6
FATA[0000] unknown runtime ""
root@firecracker:/etc/firecracker/manifests# ignite vm stop ignite-xxx a FATA[0000] can't find VM: no ID/name matches for "ignite-xxx" root@firecracker:/etc/firecracker/manifests# ignite vm stop smoke-test FATA[0000] unknown runtime "" root@firecracker:/etc/firecracker/manifests# ignite vm stop 0fd7d383-e547-4c59-918d-e238100f6ff6 FATA[0000] unknown runtime ""
please exec ignite vm rm 0fd7d383-e547-4c59-918d-e238100f6ff6
root@firecracker:/etc/firecracker/manifests# ignite vm rm 0fd7d383-e547-4c59-918d-e238100f6ff6
FATA[0000] 0fd7d383-e547-4c59-918d-e238100f6ff6 is running
root@firecracker:/etc/firecracker/manifests# ignite vm stop 0fd7d383-e547-4c59-918d-e238100f6ff6
FATA[0000] unknown runtime ""
root@firecracker:/etc/firecracker/manifests# ignite vm kill 0fd7d383-e547-4c59-918d-e238100f6ff6
FATA[0000] unknown runtime ""
root@firecracker:/etc/firecracker/manifests# ignite vm rm 0fd7d383-e547-4c59-918d-e238100f6ff6
FATA[0000] 0fd7d383-e547-4c59-918d-e238100f6ff6 is running
root@firecracker:/etc/firecracker/manifests# ignite vm rm 0fd7d383-e547-4c59-918d-e238100f6ff6 FATA[0000] 0fd7d383-e547-4c59-918d-e238100f6ff6 is running root@firecracker:/etc/firecracker/manifests# ignite vm stop 0fd7d383-e547-4c59-918d-e238100f6ff6 FATA[0000] unknown runtime "" root@firecracker:/etc/firecracker/manifests# ignite vm kill 0fd7d383-e547-4c59-918d-e238100f6ff6 FATA[0000] unknown runtime "" root@firecracker:/etc/firecracker/manifests# ignite vm rm 0fd7d383-e547-4c59-918d-e238100f6ff6 FATA[0000] 0fd7d383-e547-4c59-918d-e238100f6ff6 is running
ok... it seems stuck there because the missing runtime. You can manually remove the vm by run
rm -rf /var/lib/firecracker/vm/*
all vm metadata are stored there. And there are devicemapper need to remove: Rundmsetup status
like:# dmsetup status ignite-981c73c5-ddaa-4bfd-b1e7-6645e91e2f75: 0 6291456 snapshot 149672/6291456 592 ignite-981c73c5-ddaa-4bfd-b1e7-6645e91e2f75-base: 0 577536 linear ignite-981c73c5-ddaa-4bfd-b1e7-6645e91e2f75-base: 577536 6291456 zero
and remove the dm prefixed with
ignite-
,like:# dmsetup remove ignite-981c73c5-ddaa-4bfd-b1e7-6645e91e2f75 # dmsetup remove ignite-981c73c5-ddaa-4bfd-b1e7-6645e91e2f75-base
root@firecracker:/etc/firecracker/manifests# ignited daemon --log-level debug &
[1] 4192
root@firecracker:/etc/firecracker/manifests# DEBU[0000] Using ignite default configurations
DEBU[0000] FileWatcher: Monitoring thread started
DEBU[0000] FileWatcher: Dispatch thread started
DEBU[0000] GenericWatchStorage: Monitoring thread started
DEBU[0000] SyncStorage: Monitoring thread started
INFO[0000] Starting reconciliation loop...
root@firecracker:/etc/firecracker/manifests# export VMFILE=/etc/firecracker/manifests/smoke-test.yml
tee "$VMFILE" > /dev/null <<EOF
apiVersion: ignite.weave.works/v1alpha4
kind: VM
metadata:
name: smoke-test
uid: $(uuidgen)
spec:
image:
oci: weaveworks/ignite-ubuntu
cpus: 2
diskSize: 3GB
memory: 800MB
ssh:
generate: true
status:
running: true
EOF
DEBU[0101] FileWatcher: Registered inotify events [notify.InCloseWrite: "/etc/firecracker/manifests/smoke-test.yml"] for path "/etc/firecracker/manifests/smoke-test.yml"
root@firecracker:/etc/firecracker/manifests# DEBU[0102] FileWatcher: Sending update: MODIFY -> "/etc/firecracker/manifests/smoke-test.yml"
DEBU[0102] FileWatcher: Dispatched events batch and reset the events cache
DEBU[0102] GenericMappedRawStorage: AddMapping: "vm/faf845f9-8e49-4ce2-af94-bc7fa4500253" -> "/etc/firecracker/manifests/smoke-test.yml"
DEBU[0102] SyncStorage: Received update {{CREATE &TypeMeta{Kind:VM,APIVersion:ignite.weave.works/v1alpha4,}} 0xc000478d80} true
DEBU[0102] SyncStorage: Sent update: {CREATE &TypeMeta{Kind:VM,APIVersion:ignite.weave.works/v1alpha4,}}
DEBU[0102] FileWatcher: Skipping suspended event MODIFY for path: "/etc/firecracker/manifests/smoke-test.yml"
INFO[0102] Creating VM "faf845f9-8e49-4ce2-af94-bc7fa4500253" with name "smoke-test"...
DEBU[0102] Ensuring image weaveworks/ignite-ubuntu:latest exists, or importing it...
DEBU[0102] Importing image with ociRef "weaveworks/ignite-ubuntu:latest"
DEBU[0102] containerd: Inspecting image "weaveworks/ignite-ubuntu:latest"
INFO[0102] Starting image import...
DEBU[0102] Allocating image file and formatting it with ext4...
DEBU[0102] Copying in files to the image file from a source...
ERRO[0102] An error occurred when processing a VM update: failed to mount image "/var/lib/firecracker/image/44c83e4c8e17c8dd/image.ext4": command ["mount" "-o" "loop" "/var/lib/firecracker/image/44c83e4c8e17c8dd/image.ext4" "/tmp/028009075"] exited with "mount: /tmp/028009075: mount failed: Operation not permitted.\n": exit status 1
root@firecracker:/etc/firecracker/manifests# ctr --namespace firecracker container ls
CONTAINER IMAGE RUNTIME
root@firecracker:/etc/firecracker/manifests# ctr --namespace firecracker task
NAME:
root@firecracker:/etc/firecracker/manifests# ctr --namespace firecracker task ls
TASK PID STATUS
root@firecracker:/etc/firecracker/manifests# cat smoke-test.yml
apiVersion: ignite.weave.works/v1alpha4
kind: VM
metadata:
created: "2023-08-08T10:25:49Z"
name: smoke-test
uid: faf845f9-8e49-4ce2-af94-bc7fa4500253
spec:
cpus: 2
diskSize: 3GB
image:
oci: weaveworks/ignite-ubuntu:latest
kernel:
cmdLine: console=ttyS0 reboot=k panic=1 pci=off ip=dhcp
oci: weaveworks/ignite-kernel:5.10.51
memory: 800MB
network: {}
sandbox:
oci: weaveworks/ignite:v0.10.0
ssh: {}
storage: {}
status:
idPrefix: ""
image:
id: null
size: 0B
kernel:
id: null
size: 0B
network:
ipAddresses: null
plugin: ""
running: true
runtime:
id: ""
name: ""
root@firecracker:/etc/firecracker/manifests# ignite ps
VM ID IMAGE KERNEL SIZE CPUS MEMORY CREATED STATUS IPS PORTS NAME
faf845f9-8e49-4ce2-af94-bc7fa4500253 weaveworks/ignite-ubuntu:latest weaveworks/ignite-kernel:5.10.51 3.0 GB 2 800.0 MB 4m6s ago Up <nil> smoke-test
So, here is the root cause why not creat a vm succesfully, it is not permitted to execute the mount command.
Please check the existed ofimage.ext4
and the mount point/tmp/028009075
, you can manually run it and check why not permitted:
mount -o loop /var/lib/firecracker/image/44c83e4c8e17c8dd/image.ext4 /tmp/028009075
Oops should have looked at the ignite log first The tmp file wasn't there - but same error after creating
It must be some perms on my proxmox VM. I will investigate later. Thanks for your time looking at this.
root@firecracker:~# ls -la /var/lib/firecracker/image/44c83e4c8e17c8dd/image.ext4 /tmp/028009075
ls: cannot access '/tmp/028009075': No such file or directory
-rw-r--r-- 1 root root 782585856 Aug 8 10:25 /var/lib/firecracker/image/44c83e4c8e17c8dd/image.ext4
root@firecracker:~# mkdir /tmp/028009075
root@firecracker:~# mount -o loop /var/lib/firecracker/image/44c83e4c8e17c8dd/image.ext4 /tmp/028009075
mount: /tmp/028009075: mount failed: Operation not permitted.
Oops should have looked at the ignite log first The tmp file wasn't there - but same error after creating
It must be some perms on my proxmox VM. I will investigate later. Thanks for your time looking at this.
root@firecracker:~# ls -la /var/lib/firecracker/image/44c83e4c8e17c8dd/image.ext4 /tmp/028009075 ls: cannot access '/tmp/028009075': No such file or directory -rw-r--r-- 1 root root 782585856 Aug 8 10:25 /var/lib/firecracker/image/44c83e4c8e17c8dd/image.ext4 root@firecracker:~# mkdir /tmp/028009075 root@firecracker:~# mount -o loop /var/lib/firecracker/image/44c83e4c8e17c8dd/image.ext4 /tmp/028009075 mount: /tmp/028009075: mount failed: Operation not permitted.
welcome, i will fix the issues here, because i am not the maintainer ,so i forked another project to fix them.
FYI I needed to set the Proxmox VM CPU Type to "Host" I can now attach/stop/rm Thanks
I followed the install instructions and the last good command was
Unfortunately the attach and subsequent commands fail.
Ignite version
I've tried this on two environments - both with the same results WSL2 with KVM enabled kernel and Debian Bullseye with kernel 5.15.74-1-pve running under proxmox.
strace prior to error message