1
0
mirror of https://github.com/rancher/os.git synced 2025-07-19 17:39:04 +00:00

Start updating zfs docs

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit 2017-01-12 11:22:22 +10:00
parent dd56abf725
commit 98bccd9eca
2 changed files with 55 additions and 18 deletions

View File

@ -7,29 +7,19 @@ redirect_from:
## Using ZFS
In order to start using ZFS, you'll need to first enable one of the [persistent consoles]({{site.baseurl}}/os/configuration/custom-console/#console-persistence) and enable [kernel headers]({{site.baseurl}}/os/configuration/kernel-modules-kernel-headers/).
#### Installing the ZFS service
```
$ sudo ros console switch ubuntu
$ sudo ros service enable kernel-headers
$ sudo ros service up kernel-headers
$ sudo ros service logs kernel-headers
$ sudo ros service enable zfs
$ sudo ros service up zfs
$ sudo ros service logs zfs
$ sudo depmod
```
When RancherOS console has reloaded, you will have logged into the persistent console. The current kernel headers will need to be downloaded using the `ros service enable` and the service will be started with `ros service up kernel-headers`.
The `zfs` service will install the kernel-headers for your kernel (if you build your own kernel, you'll need to replicate this service), and then download the [ZFS on Linux]() source, and build and install it. Then it will build a `zfs-tools` image that it can use to give you console access to the zfs tools.
You can make sure that the headers are in the right place by looking at the kernel-headers service logs.
#### Installing ZFS on Ubuntu Console
Based on the [Ubuntu ZFS docs](https://wiki.ubuntu.com/Kernel/Reference/ZFS), you only need to install `zfs` package into the Ubuntu console to enable ZFS. All the other necessary packages will be installed as its dependencies.
```
$ sudo apt update
$ sudo apt install zfs
```
Then have a look at the zfs dmks build log file - which is likely to be a file similar to `/var/lib/dkms/zfs/0.6.5.6/build/make.log`.
> *Note:* if you switch consoles, you may need to re-run `ros enable zfs`.
#### Mounting ZFS filesystems on boot

View File

@ -57,6 +57,53 @@ The config settings to set the url in which `ros` should look for an `index.yml`
For example, in RancherOS v0.7.0, the `core` repository is set to `https://raw.githubusercontent.com/rancher/os-services/v0.7.0`.
### Service development and testing
If you're building your own services in a branch on GitHub, you can push to it, and then load your service from there.
For example, when developing the zfs service:
```
rancher@zfs:~$ sudo ros config set rancher.repositories.zfs.url https://raw.githubusercontent.com/SvenDowideit/os-services/zfs-service
rancher@zfs:~$ sudo ros service list
disabled amazon-ecs-agent
disabled kernel-extras
enabled kernel-headers
disabled kernel-headers-system-docker
disabled open-vm-tools
disabled amazon-ecs-agent
disabled kernel-extras
disabled kernel-headers
disabled kernel-headers-system-docker
disabled open-vm-tools
disabled zfs
[rancher@zfs ~]$ sudo ros service enable zfs
Pulling zfs (zombie/zfs)...
latest: Pulling from zombie/zfs
b3e1c725a85f: Pull complete
4daad8bdde31: Pull complete
63fe8c0068a8: Pull complete
4a70713c436f: Pull complete
bd842a2105a8: Pull complete
d1a8c0826fbb: Pull complete
5f1c5ffdf34c: Pull complete
66c2263f2388: Pull complete
Digest: sha256:eab7b8c21fbefb55f7ee311dd236acee215cb6a5d22942844178b8c6d4e02cd9
Status: Downloaded newer image for zombie/zfs:latest
[rancher@zfs ~]$ sudo ros service up zfs
WARN[0000] The KERNEL_VERSION variable is not set. Substituting a blank string.
INFO[0000] Project [os]: Starting project
INFO[0000] [0/21] [zfs]: Starting
INFO[0000] [1/21] [zfs]: Started
INFO[0000] Project [os]: Project started
```
Beware that there is an overly aggressive caching of yml files - so when you push a new yml file to your repo, you need to
delete the files in `/var/lib/rancher/cache`.
The image that you specify in the service yml file needs to be pullable - either from a private registry, or on the Docker Hub.
### Creating your own Console
Once you have your own Services repository, you can add a new service to its index.yml, and then add a `<service-name>.yml` file to the directory starting with the first letter.