{"id":312,"date":"2013-05-25T19:25:44","date_gmt":"2013-05-26T02:25:44","guid":{"rendered":"http:\/\/blog.ls-al.com\/?p=312"},"modified":"2014-04-23T07:36:33","modified_gmt":"2014-04-23T14:36:33","slug":"sun-zfs-storage-appliance-simulator-on-ovm-or-kvm","status":"publish","type":"post","link":"https:\/\/blog.ls-al.com\/sun-zfs-storage-appliance-simulator-on-ovm-or-kvm\/","title":{"rendered":"Sun ZFS Storage Appliance Simulator on OVM or KVM"},"content":{"rendered":"

For those familiar with the excellent ZFS file system and the Sun(now Oracle) storage products built on ZFS, the ZFS storage appliance interface is very easy to use; and definitely worth considering when looking at when purchasing a SAN.<\/p>\n

Oracle has a simulator virtual machine to try out the interface. \u00a0Unfortunately it only runs on Virtualbox which is fine for those running Virtualbox on a desktop. \u00a0If you would like to run it on something more accessible by multiple users(KVM or OVM); the Solaris based image has some issues running.<\/span><\/p>\n

I recently got the Virtualbox image to run on OVM and subsequently also got it to work on KVM. \u00a0This is a quick guide how to get the Virtualbox image to run as a qcow2 image on a KVM hypervisor.
\nUpdate:<\/strong><\/span> Changed to qed format. If you don't have qed, qcow2 worked for me also.<\/p>\n

As I understand there was also a vmware image but it\u00a0disappeared\u00a0from the Oracle website. \u00a0I am not sure why Oracle does not publish at least OVM images or make an effort to run the simulator on OVM. \u00a0Maybe there is a good reason and it's possible that Oracle want to discourage it being used other than on Virtualbox. \u00a0Really not sure.<\/p>\n

Stage the Image:<\/span><\/strong>
\nDownload the simulator (link should be on this page somewhere): http:\/\/www.oracle.com\/us\/products\/servers-storage\/storage\/nas\/zfs-appliance-software\/overview\/index.html<\/p>\n

From the vbox-2011.1.0.0.1.1.8 folder copy the Sun ZFS Storage 7000-disk1.vmdk file to the KVM host and convert to qcow2.<\/p>\n

** Note my first attempt I used qcow and not qcow2 format and had issues starting the image so make sure and convert to qcow2.<\/p>\n

\r\n# qemu-img convert "Sun ZFS Storage 7000-disk1.vmdk" -O qed SunZFSStorage7000-d1.qed\r\n# image: SunZFSStorage7000-d1.qed\r\nfile format: qed\r\nvirtual size: 20G (21474836480 bytes)\r\ndisk size: 1.9G\r\ncluster_size: 65536\r\n<\/pre>\n

Create Guest:<\/strong><\/span>
\nCreate KVM guest. Use ide disk for SunZFSStorage7000-disk1.qed and specify qed format.<\/p>\n

\r\n# virsh dumpxml ZfsApp\r\n\r\n  ZfsApp\r\n...\r\n\r\n<\/pre>\r\n<address>\u00a0<\/address>\r\n<pre>\r\n...\r\n\r\n<\/pre>\r\n<address>\u00a0<\/address>\r\n<pre>\r\n...\r\n\r\n<\/pre>\n

Boot new Virtual Machine from the sol-11_1-text-x86.iso. Choose language etc. Select shell<\/strong><\/span> when menu appears.<\/p>\n

Update ZFS Image:<\/strong><\/span><\/p>\n

Now import and mount the ZFS file system. \u00a0Find the correct device name and update bootenv.rc:<\/p>\n

In my case the disk device name for the boot disk is\u00a0c7d0. \u00a0I use format to see the disk device name and then find the correct slice for the root partition. \u00a0You can use \"par\" and \"pr\" commands in format to see partitions. \u00a0In my case we are after \/dev\/dsk\/c7d0s0<\/span><\/strong> and we need to find the correct entry in the \/device tree.<\/p>\n

\r\n# format\r\nSearching for disks...done\r\n\r\nAVAILABLE DISK SELECTIONS:\r\n0. c7d0\r\n\/pci@0,0\/pci-ide@1,1\/ide@0\/cmdk@0,0\r\nSpecify disk (enter its number): ^C\r\n\r\n# ls -l \/dev\/dsk\/c7d0s0\r\nlrwxrwxrwx 1 root root 50 May 26 10:35 \/dev\/dsk\/c7d0s0 -> ..\/..\/devices\/pci@0,0\/pci-ide@1,1\/ide@0\/cmdk@0,0:a\r\n<\/pre>\n

From above I found the exact device name: \/devices\/pci@0,0\/pci-ide@1,1\/ide@0\/cmdk@0,0:a<\/p>\n

Lets go update the bootenv.rc now.<\/p>\n

\r\n# zpool import -f system\r\n\r\n# zpool list\r\nNAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT\r\nsystem 19.9G 2.03G 17.8G 10% 1.00x ONLINE -\r\n\r\n# zfs list | grep root\r\nsystem\/ak-nas-2011.04.24.1.0_1-1.8\/root 1.26G 14.4G 1.25G legacy\r\n\r\n# mkdir \/a\r\n# mount -F zfs system\/ak-nas-2011.04.24.1.0_1-1.8\/root \/a\r\n\r\n# zfs set readonly=off system\/ak-nas-2011.04.24.1.0_1-1.8\/root\r\n\r\n# cp \/etc\/path_to_inst \/a\/etc\r\n# vi \/a\/boot\/solaris\/bootenv.rc\r\n...\r\nsetprop boot \/devices\/pci@0,0\/pci-ide@1,1\/ide@0\/cmdk@0,0:a\r\n\r\n# tail -1 \/a\/boot\/solaris\/bootenv.rc\r\nsetprop boot \/devices\/pci@0,0\/pci-ide@1,1\/ide@0\/cmdk@0,0:a\r\n\r\n# bootadm update-archive -R \/a\r\nupdating \/a\/platform\/i86pc\/boot_archive\r\nupdating \/a\/platform\/i86pc\/amd64\/boot_archive\r\n\r\n# cd \/\r\nroot@solaris:~\/# umount \/a\r\nroot@solaris:~\/# zpool export system\r\n\r\n# init 0\r\n<\/pre>\n

On next boot lets make sure Solaris detect the hardware correct. \u00a0When you see grub booting edit the kernel boot line and add \"-arvs\". \u00a0Then continue booting.<\/p>\n

Probably only need to add \"-r\" but I did \"-arvs\" to see more and also get into single user mode in case I needed to do more.<\/p>\n

Once in single user mode with prompt just reboot.<\/span><\/p>\n

For me at this point the image was booting into the zfs appliance setup and I could configure it. \u00a0Also on KVM adding SATA disks worked and the zfs appliance interface could use them for pools.<\/p>\n

Update 04.23.14<\/strong>
\nI recently tried to update a simulator running on KVM but the update did not want to complete. Not sure if too many versions elapsed or something it does not like about being under KVM. Anyhow I tried moving an up to date (ak-2013.06.05.1.1) image on Virtualbox to KVM and that did work.<\/p>\n","protected":false},"excerpt":{"rendered":"

For those familiar with the excellent ZFS file system and the Sun(now Oracle) storage products built on ZFS, the ZFS<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,29,24,30],"tags":[],"class_list":["post-312","post","type-post","status-publish","format-standard","hentry","category-kvm","category-ovm","category-virtualbox","category-zfs"],"_links":{"self":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/312","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/comments?post=312"}],"version-history":[{"count":0,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/312\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/media?parent=312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/categories?post=312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/tags?post=312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}