khenidak/dysk

How to deploy dysk.ko on a VM?

Closed this issue · 8 comments

currently it's

cd module # or download location
sudo insmod dysk.ko

But after reboot, dysk.ko module will disappear, is there any better dysk deployment suggestion?

docker run --rm -it --privileged  -v /usr/src:/usr/src -v /lib/modules:/lib/modules khenidak/dysk-installer:1.0

more details here: https://github.com/khenidak/dysk/blob/master/docs/build-install.md

This is really designed to work kubernetes cluster nodes.

@khenidak there is dysk installation error on my Ubuntu 16.04 VM:

azureuser@k8s-master-34763380-0:~$ uname -r
4.11.0-1015-azure
$ sudo docker run --rm \
> -it \
> --privileged \
> -v /usr/src:/usr/src \
> -v /lib/modules:/lib/modules \
> khenidak/dysk-installer:1.0
Unable to find image 'khenidak/dysk-installer:1.0' locally
1.0: Pulling from khenidak/dysk-installer

c2ca09a1934b: Pull complete
d6c3619d2153: Pull complete
0efe07335a04: Pull complete
6b1bb01b3a3b: Pull complete
43a98c187399: Pull complete
1415263ae9f9: Pull complete
654b338b00c7: Pull complete
Digest: sha256:6c44039fc334cd6aa396c9a574808fe0f3df0395c655d5c072e62ca1450de024
Status: Downloaded newer image for khenidak/dysk-installer:1.0
/etc/install_dysk.sh: line 56: cd: /tmp/6e14ea59a5404a8eb6e864485005f1b61a207ba0/dysk//module/: No such file or directory
modinfo: ERROR: Module dysk.ko not found.
INF: No dysk source found @ /tmp/6e14ea59a5404a8eb6e864485005f1b61a207ba0/dysk/ .. cloning
Cloning into 'dysk'...
remote: Counting objects: 234, done.
remote: Compressing objects: 100% (89/89), done.
remote: Total 234 (delta 65), reused 101 (delta 39), pack-reused 105
Receiving objects: 100% (234/234), 7.34 MiB | 0 bytes/s, done.
Resolving deltas: 100% (105/105), done.
Note: checking out '6e14ea59a5404a8eb6e864485005f1b61a207ba0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 6e14ea5... AZ optimization: use slab for __reqstate __resstate objects and move it to GFP_NOIO
INF: /tmp/6e14ea59a5404a8eb6e864485005f1b61a207ba0/dysk//module/dysk.ko is not there, building it
make -C /lib/modules/4.11.0-1015-azure/build M=/tmp/6e14ea59a5404a8eb6e864485005f1b61a207ba0/dysk/module clean
make[1]: Entering directory '/usr/src/linux-headers-4.11.0-1015-azure'
make[1]: Leaving directory '/usr/src/linux-headers-4.11.0-1015-azure'
make -C /lib/modules/4.11.0-1015-azure/build/ M=/tmp/6e14ea59a5404a8eb6e864485005f1b61a207ba0/dysk/module modules
make[1]: Entering directory '/usr/src/linux-headers-4.11.0-1015-azure'
  CC [M]  /tmp/6e14ea59a5404a8eb6e864485005f1b61a207ba0/dysk/module/dysk_utils.o
  CC [M]  /tmp/6e14ea59a5404a8eb6e864485005f1b61a207ba0/dysk/module/dysk_worker.o
  CC [M]  /tmp/6e14ea59a5404a8eb6e864485005f1b61a207ba0/dysk/module/dysk_bdd.o
  CC [M]  /tmp/6e14ea59a5404a8eb6e864485005f1b61a207ba0/dysk/module/az.o
  LD [M]  /tmp/6e14ea59a5404a8eb6e864485005f1b61a207ba0/dysk/module/dysk.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/6e14ea59a5404a8eb6e864485005f1b61a207ba0/dysk/module/dysk.mod.o
  LD [M]  /tmp/6e14ea59a5404a8eb6e864485005f1b61a207ba0/dysk/module/dysk.ko
make[1]: Leaving directory '/usr/src/linux-headers-4.11.0-1015-azure'
INF: installing dysk kernel module tag:6e14ea59a5404a8eb6e864485005f1b61a207ba0
modinfo: ERROR: Module dysk not found.
$ docker version
Client:
 Version:      1.12.6
 API version:  1.24
 Go version:   go1.6.4
 Git commit:   78d1802
 Built:        Tue Jan 10 20:38:45 2017
 OS/Arch:      linux/amd64

Server:
 Version:      1.12.6
 API version:  1.24
 Go version:   go1.6.4
 Git commit:   78d1802
 Built:        Tue Jan 10 20:38:45 2017
 OS/Arch:      linux/amd64

while the recently deployed k8s cluster VMs are all using 1.12.6

OK - yesterday, when i looked at this it was after a 16 work day. So i missed the fact that there was a bug in the script. This should work even on older versions of docker. please re-check (delete + re-pull the installer image please).