Skip to content

15.0.5 - Unable to create vm from zfs snapshot #855

Description

@jas-s2r

I would like to use in a remote host the latest replicated snapshot for a vm dataset.
The vm is runs Ubuntu, it has the main dataset in zroot/jails/ubuntu2
and it latest snapshot is: zroot/jails/ubuntu2@autosnap_2026-03-27_18:00:00_hourly

disk1 is a zvol

[freebsd:/usr/home/jas $]> zfs list | grep ubuntu
zroot/jails/ubuntu2                        96.0G   886G   312K  /usr/jails/vm/ubuntu2
zroot/jails/ubuntu2/disk1                  80.1G   950G  9.89G  -


zfs list -t snapshot | grep autosnap_2026-03-27_18
zroot/jails/ubuntu2@autosnap_2026-03-27_18:00:00_hourly                                  0B      -   284K  -
zroot/jails/ubuntu2/disk1@autosnap_2026-03-27_18:00:00_hourly                         13.1M      -  9.87G  -

I created on the remote host a vm using bconstruct-tui using Linux as profile and in zfs_snapsrc I specified the latest base dataset as source snapshot.

jas@msa2:~ $ sudo cbsd bcreate jname=vm-ubuntu vm_os_profile=Ubuntuserver-20-x86_64 vm_os_type=linux bhyve_vnc_tcp_bind=0.0.0.0, vm_cpus=32 vm_ram=32g zfs_snapsrc=zroot/jails/ubuntu2/disk1@autosnap_2026-03-27_18:00:00_hourly

Global VM ZFS guid: 3089370862854145632
To edit VM properties use: cbsd bconfig jname=vm-ubuntu
To start VM use: cbsd bstart vm-ubuntu
To stop VM use: cbsd bstop vm-ubuntu
To remove VM use: cbsd bremove vm-ubuntu
For attach VM console use: cbsd blogin vm-ubuntu

Creating vm-ubuntu complete: Enjoy!

zfs list | grep vm-ubuntu
pool/vm-ubuntu               384K  1.27T   384K  /pool/jails/vm/vm-ubuntu

If I enter into the vm's directory I don't see the dsk1.vhd created:


jas@msa2:~ $ cd ~cbsd/vm/vm-ubuntu/
jas@msa2:/pool/jails/vm/vm-ubuntu $ ls -al
total 73
drwxrwx---  15 cbsd cbsd     25 Mar 27 23:33 .
drwxrwxr-x   3 root cbsd      3 Mar 27 23:33 ..
-rw-r--r--   1 root cbsd 540672 Mar 27 23:33 BHYVE_UEFI_VARS.fd
drwxr-xr-x   2 cbsd cbsd      3 Oct 19 10:39 create.d
drwxrwx---   2 root cbsd      4 Mar 27 23:33 etc
drwxr-xr-x   2 cbsd cbsd      3 Oct 19 10:39 facts.d
drwxrwxr-x   2 root cbsd      5 Mar 27 23:33 helpers
-rw-r--r--   1 root cbsd      0 Mar 27 23:33 jail.limits
-rw-rw----   1 cbsd cbsd  77824 Mar 27 23:33 local.sqlite
-rw-rw----   1 cbsd cbsd  32768 Mar 27 23:33 local.sqlite-shm
-rw-rw----   1 cbsd cbsd      0 Mar 27 23:33 local.sqlite-wal
drwxr-xr-x   2 cbsd cbsd      3 Oct 19 10:39 master_create.d
drwxr-xr-x   2 cbsd cbsd      3 Oct 19 10:39 master_poststart.d
drwxr-xr-x   2 cbsd cbsd      3 Oct 19 10:39 master_poststop.d
drwxr-xr-x   2 cbsd cbsd      3 Oct 19 10:39 master_prestart.d
drwxr-xr-x   2 cbsd cbsd      3 Oct 19 10:39 master_prestop.d
drwxr-xr-x   2 cbsd cbsd      3 Oct 19 10:39 master_reboot.d
-rw-------   1 root cbsd   4564 Mar 27 23:33 rc.conf_vm-ubuntu
drwxr-xr-x   2 cbsd cbsd      3 Oct 19 10:39 remove.d
drwxr-xr-x   2 cbsd cbsd      3 Oct 19 10:39 start.d
lrwxrwxr-x   1 root cbsd     51 Mar 27 23:33 stats.conf -> /pool/jails/jails-system/vm-ubuntu/stats.conf.72032
-rw-rw-r--   1 cbsd cbsd    552 Mar 27 23:33 stats.conf.72032
lrwxrwxr-x   1 root cbsd     51 Mar 27 23:33 stats.json -> /pool/jails/jails-system/vm-ubuntu/stats.json.72032
-rw-rw-r--   1 cbsd cbsd    538 Mar 27 23:33 stats.json.72032
drwxr-xr-x   2 cbsd cbsd      3 Oct 19 10:39 stop.d

Could it be that cbsd is not converting/creating the volume based on the source snapshot?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions