Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

fix new volume populate #358

Merged
merged 1 commit into from
Aug 1, 2018
Merged

fix new volume populate #358

merged 1 commit into from
Aug 1, 2018

Conversation

bergwolf
Copy link
Member

Allow to populate new volumes if the target volume:

  1. does not exist
  2. has only . and ..
  3. has only ., .. and an empty lost+found dir

Allow to populate new volumes if the target volume:
1. does not exist
2. has only . and ..
3. has only ., .. and an empty lost+found dir

Signed-off-by: Peng Tao <bergwolf@gmail.com>
@bergwolf
Copy link
Member Author

bergwolf commented Aug 1, 2018

Before patch, empty nfs volume is not populated.

[~]$pkt run --name optiways-storage -d -v optiways:/fio hyperhq/nfs-server
447af39705df0f61a042078479d82d11dc7482835dd37353d5c5edfdba2b052c
[~]$pkt run --rm -it --volumes-from optiways-storage --name optiways-grpc-server bergwolf/ubuntu-fio
root@20bb4831f946:/# ls fio
root@20bb4831f946:/# df
Filesystem       1K-blocks   Used Available Use% Mounted on
/dev/sda          10190100 224320   9425108   3% /
devtmpfs            249952      0    249952   0% /dev
tmpfs               253156      0    253156   0% /dev/shm
rootfs              249952  16164    233788   7% /etc/hostname
172.16.0.35:/fio  10190848  36864   9613312   1% /fio
share_dir             1024      4      1020   1% /etc/hosts

After patch, empty nfs volume is populated with data on rootfs.

[~]$pkt run --name optiways-storage -d -v optiways:/fio hyperhq/nfs-server
0d9bf919b6a15d06237e3fad6fbb92217d1dcd9357d617785d6456826ba3342e
[~]$pkt run --rm -it --volumes-from optiways-storage --name optiways-grpc-server bergwolf/ubuntu-fio
root@59f495c1850f:/# ls fio
128k-read.fio  128k-write.fio  4k-read.fio  4k-write.fio  dev.fio  fs.fio  largefile.fio
root@59f495c1850f:/# df
Filesystem       1K-blocks   Used Available Use% Mounted on
/dev/sda          10190100 224320   9425108   3% /
devtmpfs            249952      0    249952   0% /dev
tmpfs               253156      0    253156   0% /dev/shm
rootfs              249952  16168    233784   7% /etc/hostname
172.16.0.29:/fio  10190848  36864   9613312   1% /fio
share_dir             1024      4      1020   1% /etc/hosts

@bergwolf bergwolf mentioned this pull request Aug 1, 2018
@gnawux
Copy link
Member

gnawux commented Aug 1, 2018

LGTM

@gnawux gnawux merged commit 6fef3e0 into hyperhq:master Aug 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants