bhyve bhyve create raw vm failed in freebsd15 .

dear all :
i want to create a vm with vm-bhyve...but got error in below
#vm create -t centos7 -i ensp_pro.raw ensp_pro
WARNING: Image format was not specified for '/systempool/vm/ensp_pro/disk0.img' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
qemu-img: Use the --shrink option to perform a shrink operation.
qemu-img: warning: Shrinking an image will delete all data beyond the shrunken image's end. Before performing such an operation, make sure there is no important data there.
/usr/local/sbin/vm: ERROR: failed to resize img file with qemu-img

please help me . how to create it ?
 
-i is not a valid option for vm create .... What are you trying to do here?
 
I have a page on vm-bhyve, which also has a link to vermaden's page on it (which is more complete).
But in your case, I think all you need is
Code:
 vm create -t centos7 myvm
with myvm being the name of the vm. For most things I like to also have -m 4096 (-m is for memory) and you can have -c for number of cpus, as well as -s for size (default is 20G I think)
 
-i is not a valid option for vm create .... What are you trying to do here?
Dear SirDice :
i have fellowed below manual...
Using cloud images
You can use cloud images to create virtual machines. The vm img command will download the image to datastore and uncompress it if needed (.xz, .tar.gz, and .gz files are supported). The image should be in RAW or QCOW2 format. To use this feature you'll need install qemu-tools package:

i have donwload the ensp was ensp.qcow2 file , then used qemu-tools to convert it to raw.
qemu-img convert ensp.qcow2 ensp_pro.raw


# vm create -t freebsd-zvol -i ensp_pro.raw enspvm

ensp_pro.raw was the vm downloaing from huawei.com for Enterprise network simulation platform (eNSP) Pro . i want to build this vm with bhyve ...
  • Windows: eNSP**_Software_X8664_release.tar.gz
  • Linux: eNSP**_Software_X8664_release.qcow2
thanks.

do you have some way to rebuild ensp vm with bhyve ? thanks.
 
The template has a disk definition, it creates the disk. Then just dd(1) your raw image onto that VM's disk (zvol, image, whatever the template created).

centos7 template:
Code:
loader="uefi"
graphics="yes"
xhci_mouse="yes"
cpu=1
memory=512M
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0.img"                <----- disk of the VM!
freebsd-zvol template:
Code:
loader="bhyveload"
cpu=1
memory=256M
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0"                      <------ disk of the VM!
disk0_dev="sparse-zvol"

There is NO -i option for the vm create .... command.
Code:
     create [-d datastore] [-t template] [-s size] name
             Create a new virtual machine.

             Unless specified, the default.conf template will be used and a
             20GB virtual disk image is created.  This command will create the
             virtual machine directory $vm_dir/$name, and create the
             configuration file and empty disk image within.

             -d datastore  Specify the datastore to create this virtual
                           machine under.  If not specified, the default
                           dataset will be used, which is the location
                           specified in /etc/rc.conf.

             -t template   Specifies the template to use from within the
                           $vm_dir/.templates directory.  The .conf suffix
                           should not be included.

             -s size       The size of disk image to create in bytes.  Unless
                           specified, the guest image will be a sparse file
                           20GB in size.
vm(8)
 
Back
Top