Bug 241699 - sysutils/vm-bhyve: "image provision" fails (cannot receive: failed to read from stream)
Summary: sysutils/vm-bhyve: "image provision" fails (cannot receive: failed to read fr...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Dries Michiels
URL:
Keywords: bhyve
Depends on:
Blocks:
 
Reported: 2019-11-04 05:40 UTC by Victor Sudakov
Modified: 2024-11-29 12:02 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (churchers)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Sudakov 2019-11-04 05:40:57 UTC
# vm image list
UUID                                  NAME            CREATED                                        DESCRIPTION
e9c1e962-fec3-11e9-8dec-d094668ea036  freebsd-templ1  понедельник,  4 ноября 2019 г. 12:28:20 (+07)  RELENG_11_3

# vm image provision e9c1e962-fec3-11e9-8dec-d094668ea036 test1
Unpacking guest image, this may take some time...
cannot receive: failed to read from stream
/usr/local/sbin/vm: ERROR: errors occured while trying to unpackage the image file
# 

# cat /zroot/vm/images/e9c1e962-fec3-11e9-8dec-d094668ea036.manifest 

description="RELENG_11_3"
created="понедельник,  4 ноября 2019 г. 12:28:20 (+07)"
name="freebsd-templ1"
filename="e9c1e962-fec3-11e9-8dec-d094668ea036.zfs.z"
decompress="xz -d"
#
Comment 1 Mateusz Kwiatkowski 2019-11-04 11:04:33 UTC
Hi Victor,

Thank you for reporting this. Have you tried creating image and provisioning it with english locale? I wonder if unicode characters messed something up.
Comment 2 Victor Sudakov 2019-11-04 12:11:40 UTC
(In reply to Mateusz Kwiatkowski from comment #1)

Repeated the procedure after setting "setenv LANG C", made no difference, same error.

Here is the config of the VM from which I created the image:

guest="freebsd"
loader="bhyveload"
cpu=1
memory=1G
network0_type="virtio-net"
network0_switch="internal"
disk0_type="virtio-blk"
disk0_name="disk0"
#disk0_dev="file"
#disk0_dev="zvol"
disk0_dev="sparse-zvol"
utctime="yes"
uuid="e0bf2a42-fefa-11e9-8dec-d094668ea036"
network0_mac="58:9c:fc:08:3c:02"

May this be because of the zvol? Shall I repeat the process with disk0_dev="file"? 

# cat /zroot/vm/images/a994d1bd-fefb-11e9-8dec-d094668ea036.manifest 

description="RELENG_11_3_LANG_ENG"
created="Mon Nov  4 19:07:24 +07 2019"
name="freebsd-templ1"
filename="a994d1bd-fefb-11e9-8dec-d094668ea036.zfs.z"
decompress="xz -d"
root@gw:~ #
Comment 3 Victor Sudakov 2020-01-04 10:24:53 UTC
Ping! The problem persists in vm-bhyve-1.3.0
Comment 4 Brad Martin 2020-06-06 00:34:17 UTC
This bug is still present in version 1.4.2 but I have discovered a workaround:

Workaround:
In the manifest file for a compressed image (image filename ends in .z) the decompress option is incorrectly set to "xz -d" instead of "xz -dc"  The -c option is required to stream the decompressed zfs image data to stdout which is then piped to a zfs receive.  The "vm image create" puts the incorrect option in the manifest.  The manifest can be edited to add the "c" flag as above, or the image should be created uncompressed so that it will provision correctly.
Comment 5 Victor Sudakov 2020-06-09 02:51:59 UTC
(In reply to Brad Martin from comment #4)
I confirm, the workaround with editing the manifest works.