Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devicemapper: Default to xfs instead of ext4 #17903

Merged
merged 2 commits into from Nov 11, 2015

Conversation

rhvgoyal
Copy link
Contributor

Default to xfs instead of ext4. Also give a warning if user specified a filesystem using dm.fs option and base device already has a file system which is not same as dm.fs

@@ -835,6 +843,18 @@ func getDeviceUUID(device string) (string, error) {
return uuid, nil
}

func getDeviceFS(device string) (string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that a duplicate of ProbeFsType?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Only difference seems to be that ProbeFsType() will return error if fs is anything other then ext4, xfs and btrfs. As we already use ProbeFsType(). So I can use ProbeFsType() too instead of using blkid.

… has fs

If user wants to use a filesystem it can be specified using dm.fs=<filesystem>
option. It is possible that docker already had base image and a filesystem
on that. Later if user wants to change file system using dm.fs= option
and restarts docker, that's not possible. Warn user about it.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
If platform supports xfs filesystem then use xfs as default filesystem 
for container rootfs instead of ext4. Reason being that ext4 is pre-allcating
lot of metadata (around 1.8GB on 100G thin volume) and that can take long
enough on AWS storage that systemd times out and docker fails to start.

If one disables pre-allocation of ext4 metadata, then it will be allocated
when containers are mounted and we will have multiple copies of metadata
per container. For a 100G thin device, it was around 1.5GB of metadata
per container.

ext4 has an optimization to skip zeroing if discards are issued and
underlying device guarantees that zero will be returned when discarded
blocks are read back. devicemapper thin devices don't offer that guarantee
so ext4 optimization does not kick in. In fact given discards are optional
and can be dropped on the floor if need be, it looks like it might not be
possible to guarantee that all the blocks got discarded and if read back
zero will be returned.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
@rhvgoyal
Copy link
Contributor Author

@tiborvass Pushed V2 of patches. I think I have taken care of all review comments. PTAL.

@crosbymichael
Copy link
Contributor

LGTM

2 similar comments
@anusha-ragunathan
Copy link
Contributor

LGTM

@tiborvass
Copy link
Contributor

LGTM

tiborvass added a commit that referenced this pull request Nov 11, 2015
Devicemapper: Default to xfs instead of ext4
@tiborvass tiborvass merged commit adb1454 into moby:master Nov 11, 2015
@tiborvass tiborvass added this to the 1.9.1 milestone Nov 11, 2015
@bmangold
Copy link

I ran engine 1.9.0 + this change on aws for rhel 7.1 SELinux and centos ... looks good. No issues with starting the daemon after install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants