Freenas Vm Host

Freenas

In this repo, you will find all of the 'canned templates' for creating VMson FreeNAS 10 - what you see when you use the vm template show command.

Use an existing VM as a template

  • Running pfSense as a VM guest on FreeNAS 9.10 host using Bhyve Update: FreeNAS 9.10 is now marked STABLE and 9.3 is in maintenance mode until the version 10 release. There are issues to be aware of though, I have updated the post below, new information is in italics.
  • FreeNAS 11 - Creating a Windows VM Husky Media. Unsubscribe from Husky Media? Cancel Unsubscribe. Subscribe Subscribed Unsubscribe 304.
  • FreeNAS is an operating system that can be installed on virtually any hardware platform to share data over a network. FreeNAS is the simplest way to create a centralized and easily accessible place for your data. Use FreeNAS with ZFS to protect, store, backup, all of your data.
  • First, under Configure - Virtual Machine Startup/Shutdown configure your FreeNAS VM to boot first. Then give FreeNAS a post init Task (like the nutscript above) to ssh into VMware and run a command like this: ssh root@vmwarehost esxi storage core adapter rescan –all (or you can specify the iSCSI adapter).

If you would like to use an already created VM as your template do the following:

Re-install the 2x2TB drives in my Intel S2600 management host on the integrated SATA controller. Create a new FreeNAS virtual machine. Add the two drives to the VM as virtual mode RDMs. Import the existing ZFS volume that is striped across these two drives in FreeNAS. Recently we have been working on a new Proxmox VE cluster based on Ceph to host STH. During the process we have been learning quite a bit experimenting with the system. While the VMware ESXi all-in-one using either FreeNAS or OmniOS + Napp-it has been extremely popular, KVM and containers are where. May 12, 2015  Well, technically, FreeBSD will be the hypervisor host. Anyhow, starting with FreeNAS 10 (which leverages FreeBSD 10), Bhyve (part of FreeBSD 10) is available as a hypervisor. The guy running FreeNAS stated at the end of his 'State of the Union' youtube video on FreeNAS that FreeNAS 10 will have Bhyve for doing VM's.

  • Check out the repository
  • Copy and rename the folder from which your template was based on
  • Stop the running VM and use dd on the FreeBSD CLI
  • Then rename the image and compress it, this may take a while.
  • This last little rename/compress step was just to conform with the same naming conventions as my source template, at which point I then edited the template.json file in the directory created previously to correctly reference this new image and edited some of the book-keeping fields to match, then I uploaded the os.img.gz file to the location specified in the url field (which could be any HTTP server you have access to) and filled in the sha256 checksum field by running shasum -a 256 os.img.gz and pasting in the results.
  • Finally, commit the result to github with a git commit / git push, then add your github vm-templates repository under VM -> Settings in the form of https://github.com/[username]/vm-templates and voila! Your new template will now show up along with all the other templates.

Manually create a new OS template from an existing template

Here's the step-by-step process I used to create the FreeBSD-current (11.0)template, using freebsd-current as thestarting image. I also used bhyve running on FreeBSD 10.3 as the bootstraphost, though some folks have reported good results with xhyve on the Mac.

  • First, obviously, I needed to check out the vm-templates repo and start working in it:
  • Next, you have to acquire the template disk image, I copied the template that looked the most like my target template. In my case, since I was targetting another FreeBSD template, it was obvious enough to simply duplicate the existing FreeBSD 10.2-zfs template (a 10.2 install with the ZFS option selected).
  • Then I grabbed an ISO installation image from ftp.freebsd.org, as linked above, and started the steps to get bhyve ready to boot it:

Freenas 11.2 Vm

  • Then I ran bhyve's helpful vmrun.sh script to start things off.
  • At this point, FreeBSD's standard installer ran, the appropriate ZFS installation options were chosen, and I exited bhyve by selecting the loader prompt on the next reboot and typing 'quit'. This dropped me back to the shell on the host OS, where I was next able to do:

This last little rename/compress step was just to conform with the same naming conventions as my source template, at which point I then edited the template.json file in my new freebsd-11-zfs direcory to correctly reference this new image and edited some of the book-keeping fields to match, then I uploaded the os.img.gz file to the location specified in the url field (which could be any HTTP server you have access to) and filled in the sha256 checksum field by running shasum -a 256 os.img.gz and pasting in the results.

  • Finally, I committed the result to github with a git commit / git push, added my github vm-templates repository under VM -> Settings in the form of https://github.com/[username]/vm-templates and voila! My FreeNAS 10 CLI now shows:

Demonstrating that the template list is automatically pulled from github.

  • Of course, the final proof was to actually create a VM with the new template on my FreeNAS 10 box:

Freenas Virtualization

Login is a root (no password), tada! Running FreeBSD-current from this new template.