Commit Graph

265 Commits

Author SHA1 Message Date
94d7dd0cf8 Merge pull request #13896 from rhvgoyal/verify-base-uuid
devicemapper: Compare uuid of base device on startup
Upstream-commit: 85d3b75dfddde62bf1c934afd1cd41ee12309223
Component: engine
2015-06-17 11:30:04 -07:00
f21492c649 devicemapper: Compare uuid of base device on startup
It is easy for one to use docker for a while, shut it down and restart
docker with different set of storage options for device mapper driver
which will effectively change the thin pool. That means any of the
metadata stored in /var/lib/docker/devicemapper/metadata/ is not valid
for the new pool and user will run into various kind of issues like
container not found in the pool etc.

Users think that their images or containers are lost but it might just
be the case of configuration issue. People might use wrong metadata
with wrong pool.

To detect such situations, save UUID of base image and once docker
starts later, query and compare the UUID of base image with the
stored one. If they don't match, fail the initialization with the
error that UUID failed to match.

That way user will be forced to cleanup /var/lib/docker/ directory
and start docker again.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: c06b05b11e6bbe48ae3ca140096d7862e5e312f8
Component: engine
2015-06-16 21:12:27 -04:00
8810db85be Merge pull request #13198 from rhvgoyal/extend-docker-inspect
docker-inspect: Extend docker inspect to export image metadata related to graph driver
Upstream-commit: e69df2589c1220217054abdc6a361b55990b3c0b
Component: engine
2015-06-16 15:03:14 -05:00
1868142b6e Fix circular import for windows vfs graphdriver
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 49834e8d5922f8c256124177b188d89007af03f6
Component: engine
2015-06-16 09:08:10 -04:00
bc9e6b9254 Windows - Really fix VFS this time
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 59cfc089820f6f8a2a5f24ddfcf0fe1328c9568c
Component: engine
2015-06-15 15:09:48 -07:00
4a6f8e2e63 docker-inspect: Extend docker inspect to export image/container metadata related to graph driver
Export image/container metadata stored in graph driver. Right now 3 fields
DeviceId, DeviceSize and DeviceName are being exported from devicemapper.
Other graph drivers can export fields as they see fit.

This data can be used to mount the thin device outside of docker and tools
can look into image/container and do some kind of inspection.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 407a626be62996cd6385ea4d80e669ab83f5f04d
Component: engine
2015-06-15 14:05:10 -04:00
57eb64c9c0 Carry of PR #13520
Removinig files

Signed-off-by: Mary Anthony <mary@docker.com>
Upstream-commit: cd44018856be421497a35d96f88dd0eec42fae43
Component: engine
2015-06-13 09:27:30 -07:00
06662e40d0 Merge pull request #13494 from Microsoft/10662-vfsdriveroption
Windows: Allow VFS
Upstream-commit: e7533d7f81fdb3d33efd91c751d25b9d3b80f4e1
Component: engine
2015-06-12 11:12:32 -07:00
01cbc209ac Windows: Allow VFS
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: e89f837bc6a26e08e02f25b6e474d4ad7bdfb101
Component: engine
2015-06-12 09:21:17 -07:00
9a58c12eeb zfs: correctly apply selinux context
fixes #13858

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
Upstream-commit: 19c31a703fb84f1079cc2466d435cb4913a4bfd2
Component: engine
2015-06-11 11:11:37 +02:00
6c4935d15a Merge pull request #13832 from mapk0y/fix-error-msg
fix typo.
Upstream-commit: add64dc297a4549e1abe0e0c5176eeabd198fb47
Component: engine
2015-06-10 16:38:07 -04:00
8e654cb58d fix typo.
Signed-off-by: mapk0y <mapk0y@gmail.com>
Upstream-commit: 416e855e9b33464c81e86ff47ed19c93a781e604
Component: engine
2015-06-10 06:26:07 +09:00
bd6a18d14c Windows: Don't build Linux graph drivers
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 9a9dc5ba96d2661f5dc2037db44d0984d2129946
Component: engine
2015-06-08 15:09:33 -07:00
fe89ed5cd6 avoid 88-chars mountpoint length limit on freebsd
Signed-off-by: Alexey Guskov <lexag@mail.ru>
Upstream-commit: 112b7e654691caa2b5ec283d70cf36245dfab365
Component: engine
2015-05-29 16:33:04 +03:00
ffcd5b22b0 zfs magicnumber check on freebsd is fixed
Signed-off-by: Alexey Guskov <lexag@mail.ru>
Upstream-commit: 36bf6e44402bc6a0fbf169a73579e47e3f97f1a3
Component: engine
2015-05-28 18:38:08 +03:00
e6982a9c9b Windows: graphdriver refactor
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 4e8b2509fd60bf1ab771db618301650b988b549b
Component: engine
2015-05-20 08:51:27 -07:00
8911352f54 Fix Put without Get in overlay
It is called for example on daemon start after crash

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 3916561619d45a3d8ca17dfa467149824111023a
Component: engine
2015-05-19 09:32:23 -07:00
edeb4ed190 Merge pull request #13249 from coolljt0725/fix_incorrect_document_of_storage_opt
Fix incorrect document storage-opt
Upstream-commit: 70e9e4bf9f7901137483fb4c9635d8d3cf686328
Component: engine
2015-05-18 11:35:01 -07:00
55843a6210 Fix incorrect document storage-opt
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 0204ecdf707bdbb3caa76548e576f4ff0706fc46
Component: engine
2015-05-15 19:13:07 +08:00
4a6cf355cf Windows: No ZFS graphdriver
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 35cdcbb323bc76a0874962c08de627221bf4880d
Component: engine
2015-05-14 15:57:45 -07:00
9a838129e5 zfs: update filesystem cache on filesystem creation/deletion
Previously the cache was only updated once on startup, because the graph
code only check for filesystems on startup. However this breaks the API as it
was supposed and so unit tests.

Fixes #13142

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
Upstream-commit: 2cb23527e4f3f74a9fb98ddc7c0c11c50c3f07d2
Component: engine
2015-05-12 13:06:41 +02:00
30e28d31e0 zfs: retrieve all filesystems on startup at once
The docker graph call driver.Exists() on initialisation for each filesystem in
the graph. This results will results in a lot `zfs get all` commands. To reduce
this, retrieve all descend filesystem at startup and cache it for later checks

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
Upstream-commit: bad25ccf978b56da6fa181439504ab33906524cd
Component: engine
2015-05-08 17:49:39 +02:00
f9c00c527b zfs: improve performance by using legacy mounts
instead of let zfs automaticly mount datasets, mount them on demand using mount(2).
This speed up this graph driver in 2 ways:
- less zfs processes needed to start a container
- /proc/mounts get smaller, so zfs userspace tools has less to read (which can
  a significant amount of data as the number of layer grows)

This ways it can be also ensured that the correct mountpoint is always used.

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
Upstream-commit: 11e9167a6b45fdc134ee43e89abefd34a85cf624
Component: engine
2015-05-08 17:49:39 +02:00
d9d6332c5d zfs: replace c for /proc/mounts parsing with go
Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
Upstream-commit: ee00f07ea64074e8abf7d741eed8a83da4e4b5ff
Component: engine
2015-05-08 17:49:39 +02:00
2ed25719ce zfs: refactor error handling
thanks to @calavera

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
Upstream-commit: dd614b5e34bc82c6921c44619532f2467ce43baa
Component: engine
2015-05-08 17:48:20 +02:00
59b313c381 zfs: add myself to MAINTAINERS
Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
Upstream-commit: a25195d86cb54cbad0bfe840267beaa9f0a84c74
Component: engine
2015-05-08 17:48:20 +02:00
289cc2a20f zfs: revert to NaiveGraphDriver for the moment
Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
Upstream-commit: bacecabf3be2d6b180cbe8fc37ff90f79138bb6e
Component: engine
2015-05-08 17:48:20 +02:00
e5820ed7e4 Implement Docker on ZFS
Signed-off-by: Arthur Gautier <baloo@gandi.net>
Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
Upstream-commit: d5151ca8ab5d90300839c8572cb96577de4d6233
Component: engine
2015-05-08 17:48:20 +02:00
cba2f6d1b5 Merge pull request #13067 from burke/faster-commit-for-overlay
overlay: skip superfluous metadata sets on commit
Upstream-commit: 93536cfa76fe57b8bc319c747596be935b385871
Component: engine
2015-05-07 13:58:46 -07:00
0b0c4b0dfa overlay: skip superfluous metadata sets on commit
Signed-off-by: Burke Libbey <burke.libbey@shopify.com>
Upstream-commit: bc5503f46bdc0816d90d99bd516afaa81717346a
Component: engine
2015-05-07 16:15:54 -04:00
11e5be135f Merge pull request #12190 from rhvgoyal/deferred-removal
Devicemapper: Provide deferred device removal capability
Upstream-commit: 56c991781564e8cc292166d3b3e27e304c240468
Component: engine
2015-05-04 14:22:52 -07:00
a580a2dfa9 Merge pull request #12903 from rhvgoyal/disable-discards
devmapper: Disable mount option "discard" by default
Upstream-commit: 2e49281bd085d84babe8b3243de1e97c2d12dac1
Component: engine
2015-05-04 18:35:25 +03:00
63fe58e0de devmapper: Disable mount option "discard" by default
Right now devicemapper mounts thin device using online discards by default
and passes mount option "discard". Generally people discourage usage of
online discards as they can be a drain on performance. Instead it is 
recommended to use fstrim once in a while to reclaim the space.

In case of  containers, we recommend to keep data volumes separate. So
there might not be lot of rm, unlink operations going on and there might
not be lot of space being freed by containers. So it might not matter
much if we don't reclaim that free space in pool.

User can still pass mount option explicitly using dm.mountopt=discard to
enable discards if they would like to.

So this is more like setting the containers by default for better performance
instead of better space efficiency in pool. And user can change the behavior
if they don't like default behavior.

Reported-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 04adaaf1ee1688ff48cb8f541dcb80e965f45080
Component: engine
2015-05-01 09:16:31 -04:00
954f940156 Small if err cleaning
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 844538142d95c1b7dda1bb2903179510105fe9b5
Component: engine
2015-04-27 21:50:33 +02:00
c9ef8ab72d devmapper: Cancel deferred deactivation if device is reactivated
If device is being reactivated before it could go away and deferred 
deactivation is scheduled on it, cancel it.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: ddc8acebecfdc7dbc0357f5c009fb3ee0a2ae906
Component: engine
2015-04-21 18:14:59 -04:00
be8151e80b devmapper: Export deferred removal status in status
This will help with debugging as one could just do "docker info" and figure
out of deferred removal is enabled or not.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 66a53819aea2ab1ab0d50be1f8d32fcb2427cd78
Component: engine
2015-04-21 18:14:59 -04:00
807639ca3d devmapper: Use deferred removal
Make use of deferred removal of devices.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: e37c7203bb1d840e9383ac08bf87afda3e722344
Component: engine
2015-04-21 18:14:59 -04:00
de64b1affe devmapper: Provide a new parameter dm.deferred_device_removal
Provide a new command line knob dm.deferred_device_removal which will enable
deferred device deactivation if driver and library support it.

This patch also checks for library support and driver version.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 15c158b20725fd62e2ee0a72ffaf1617852cd0d9
Component: engine
2015-04-21 18:14:59 -04:00
26d411e68d Updated message severity in graphdriver
Signed-off-by: Megan Kostick <mkostick@us.ibm.com>
Upstream-commit: cdc63ce5d032de593fc2fd13997311b316c0103b
Component: engine
2015-04-17 10:56:12 -07:00
78acc699c1 graphdriver: prefer prior driver state
Before this, a storage driver would be defaulted to based on the
priority list, and only print a warning if there is state from other
drivers.

This meant a reordering of priority list would "break" users in an
upgrade of docker, such that there images in the prior driver's state
were now invisible.

With this change, prior state is scanned, and if present that driver is
preferred.

As such, we can reorder the priority list, and after an upgrade,
existing installs with prior drivers can have a contiguous experience,
while fresh installs may default to a driver in the new priority list.

Ref: https://github.com/docker/docker/pull/11962#issuecomment-88274858

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: b68e161e5b76b5f622cf4fc226df46cbe314ea1e
Component: engine
2015-04-13 21:37:55 -04:00
81dfdc7b63 Add detection for F2Fs and JFS
Signed-off-by: Megan Kostick <mkostick@us.ibm.com>

Alphabetize FSMagic list to make more human-readable.

Signed-off-by: Megan Kostick <mkostick@us.ibm.com>
Upstream-commit: 7e2d05b4938c010bf15224bd2857e2dca92ec9b3
Component: engine
2015-04-13 17:01:43 -07:00
44fddcaf4b Merge pull request #11412 from vbatts/vbatts-dm_sync_is_required
devmapper: udev sync is a requirement
Upstream-commit: 23c12dabbdb7f895f606bbf2438599d29c53df3a
Component: engine
2015-04-10 16:52:38 -04:00
d89c51c3b5 devmapper: storage-opt override for udev sync
This provides an override for forcing the daemon to still attempt
running the devicemapper driver even when udev sync is not supported.

Intended to be a very clear impairment for those choosing to use it. If
udev sync is false, there will still be an error in the daemon logs,
even when the override is in place. The docs have an explicit WARNING.

Including link to the docs for users that encounter this daemon error
during an upgrade.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 0e21782de5c038dfa3cfdfc7655b9e6b143baa7b
Component: engine
2015-04-10 15:43:16 -04:00
25835c875f devmapper: udev sync is a requirement
closes #10664
closes #4036

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: ca628c6216ade64790dfbfe388fe4769433ec4aa
Component: engine
2015-04-06 15:17:57 -04:00
68a3810b3c devmapper: Retry device removal after 100ms instead of 10ms
Right now we try device removal at the interval of 10ms and keep on trying
till either device is removed or 10 seconds are over. That means if device
is busy, we will try 1000 times in those 10 seconds.

Sounds too high a frequency of deivce removal retrial. All the logs are
filled easily. I think it is a good idea to slow down a bit and retry at
the interval of 100ms instead of 10ms.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: c737800b7faced4b53854c8cb6766ebe58a3c3e9
Component: engine
2015-04-02 16:47:14 -04:00
a0411faab2 devmapper: Remove call to waitClose()
During device removal, we are first waiting for device to close() in a tight
loop for 10 seconds. I am not sure why do we need it. First of all we come
here once the umount() is successful so device should be free. For some reason
of device is temporarily busy, then removeDevice() logic retries device removal
logic in a loop for 10 seconds and that should cover it. Can't see why one
more 10 seoncds loop is required before attempting device removal.

One loop should be able to cover all the temporary device busy conditions and
if condition is not temporary then 10 seconds loop is not going to help anyway.

So instead of two loops of 10 seconds each, I am converting it to a single
loop of 20 seconds. May be 10 second loop is good enough but for now I am
keeping it 20 seconds to avoid any regressions.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: f74d12012c21349b2bd51d9c395a99331ff0a9a5
Component: engine
2015-04-02 16:47:14 -04:00
12beb9b276 devmapper: Remove extra wait after device removal
Currently in device removal path (device deactivation), we wait
for 10 seconds for devive to actually go away. waitRemove().

In current code this is not required. If dm removal task has completed
and one has done the wait on udev cookie, then device is gone and there
is no need to write another loop to wait for device removal.

This patch removes the waitRemove() which waits for 10 seconds after
device removal. This seems unnecessary.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: dbf04ec4e2a6b4fe73f7f300918a906c0ff1a37b
Component: engine
2015-04-02 16:47:14 -04:00
cb8a2764e5 devicemapper: Remove debug messages from RemoveDevice()
devmapper graph driver retries device removal 1000 times in case of failure
and if this fills up console with 1000 messages (when daemon is running in
debug mode). So remove these debug messages.
 
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: cb7c893275c32ddfa775c3f22869a9c211024c71
Component: engine
2015-04-02 16:47:14 -04:00
2b212c76e7 devmapper: Fix libdm logging
There are issues with libdm logging. Right now if docker daemon is run
in debug mode, logging by libdm is too verbose. And if a device can't 
be removed, thousands of messages fill the console and one can not see
what's going on.

This patch removes devicemapper.LogInitVerbose() call as that call will
only work if docker was not registering its own log handler with libdm.
For some reason docker registers one with libdm and libdm hands over
all the messages to docker (including debug ones). And now it is up to
devmapper backend to figure out which ones should go to console and
which ones should not.

So by default log only fatal messages from libdm. One can easily modify
the code to change it for debugging purposes.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: e07d3cd9acf14219f33e12375fb8c2e3fe02ad0c
Component: engine
2015-04-02 16:47:14 -04:00
3a4dbacc2f graphdriver: promote overlay above vfs
It's about time to let folks not hit 'vfs', when 'overlay' is supported
on their kernel. Especially now that v3.18.y is a long-term kernel.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 2c72ff1dbfa83aa8f797bdfebaacb8a919677326
Component: engine
2015-03-31 17:18:49 -04:00