From owner-freebsd-virtualization@FreeBSD.ORG Mon Feb 18 03:35:19 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 821) id 344F84D8; Mon, 18 Feb 2013 03:35:19 +0000 (UTC) Date: Mon, 18 Feb 2013 03:35:19 +0000 From: John To: FreeBSD Virtualization Subject: ReadOnly iSCSI disk with Virtualbox? Message-ID: <20130218033519.GA34629@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2013 03:35:19 -0000 Hi Folks, I've been using VB with iSCSI disks hosted on a FreeBSD system using istgt for a while with no problems. The system hosting VB is fbsd9.1. Recently I wanted to use a single zvol and export it to 100+ VB systems in ReadOnly mode. The OS on the way up recognizes the hd is R/O and mounts a tmpfs filesystem for those areas that need it. My thoughts on enforcing the ReadOnly disk: 1. Attach the iSCSI drive with "--mtype readonly" 2. Export the zvol with the istgt option "ReadOnly Yes" Unfortunately, neither of the above work. #1 fails to attach the disk to the VM: VBoxManage storageattach $vmname --storagectl "SATA Controller" \ --type hdd \ --port $devport --device 0 \ --medium iscsi \ --server $ip \ --tport $port \ --target $iqn \ --mtype shareable \ --initiator $initiator VBoxManage: error: Cannot change type for medium '192.168.22.231|iqn.2012-02.com.example:jwd1:1' to 'Readonly' since it is a hard disk VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component Medium, interface IMedium, callee nsISupports VBoxManage: error: Context: "COMSETTER(Type)(mediumType)" at line 678 of file VBoxManageStorageController.cpp VBoxManage: error: Failed to set the medium type The #2 option also fails: The attach of the hard drive succeeds, the failure occurs when the virtual machine is started: VBoxHeadless --startvm jwd1 ... Error: failed to start machine. Error message: VD: error VERR_VD_IMAGE_READ_ONLY opening image file '172.21.22.231|iqn.2012-02.com.sas.unx:jwd1:1' (VERR_VD_IMAGE_READ_ONLY). Failed to open image '172.21.22.231|iqn.2012-02.com.sas.unx:jwd1:1' in read-write mode rc=VERR_VD_IMAGE_READ_ONLY (VERR_VD_IMAGE_READ_ONLY). Failed to attach driver below us! Image is read-only. (VERR_VD_IMAGE_READ_ONLY). AHCI: Failed to attach drive to Port0 (VERR_VD_IMAGE_READ_ONLY) Has anyone else tried doing this and/or have a different of approaching the problem? Or, do I need to start patching code? Any thoughts are appreciated. Thanks, John