[lxc-devel] [lxd/master] Bugfixes
stgraber on Github
lxc-bot at linuxcontainers.org
Sat Mar 4 19:25:13 UTC 2017
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 301 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170304/558beef2/attachment.bin>
-------------- next part --------------
From c6dd45a3b16c4bcd39479cc4c467a0f184ac9e3c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Sat, 4 Mar 2017 01:46:49 -0500
Subject: [PATCH 1/2] rsync: Tweak logging a bit
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
lxd/rsync.go | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/lxd/rsync.go b/lxd/rsync.go
index f6a5ff5..6f87076 100644
--- a/lxd/rsync.go
+++ b/lxd/rsync.go
@@ -89,13 +89,14 @@ func rsyncSendSetup(path string) (*exec.Cmd, net.Conn, io.ReadCloser, error) {
// directory pointed to by path over the websocket.
func RsyncSend(path string, conn *websocket.Conn, readWrapper func(io.ReadCloser) io.ReadCloser) error {
cmd, dataSocket, stderr, err := rsyncSendSetup(path)
- if dataSocket != nil {
- defer dataSocket.Close()
- }
if err != nil {
return err
}
+ if dataSocket != nil {
+ defer dataSocket.Close()
+ }
+
readPipe := io.ReadCloser(dataSocket)
if readWrapper != nil {
readPipe = readWrapper(dataSocket)
@@ -105,12 +106,12 @@ func RsyncSend(path string, conn *websocket.Conn, readWrapper func(io.ReadCloser
output, err := ioutil.ReadAll(stderr)
if err != nil {
- shared.LogDebugf("problem reading rsync stderr %s", err)
+ return err
}
err = cmd.Wait()
if err != nil {
- shared.LogDebugf("problem with rsync send of %s: %s: %s", path, err, string(output))
+ shared.LogErrorf("Rsync send failed: %s: %s: %s", path, err, string(output))
}
<-readDone
@@ -157,15 +158,14 @@ func RsyncRecv(path string, conn *websocket.Conn, writeWrapper func(io.WriteClos
}
readDone, writeDone := shared.WebsocketMirror(conn, writePipe, stdout, nil, nil)
- data, err2 := ioutil.ReadAll(stderr)
- if err2 != nil {
- shared.LogDebugf("error reading rsync stderr: %s", err2)
- return err2
+ output, err := ioutil.ReadAll(stderr)
+ if err != nil {
+ return err
}
err = cmd.Wait()
if err != nil {
- shared.LogDebugf("rsync recv error for path %s: %s: %s", path, err, string(data))
+ shared.LogErrorf("Rsync receive failed: %s: %s: %s", path, err, string(output))
}
<-readDone
From c2e52d0be03c51d2ac402127cf4c6f793090e624 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Sat, 4 Mar 2017 14:22:08 -0500
Subject: [PATCH 2/2] doc: Improve storage doc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Closes: #3013
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
doc/storage-backends.md | 37 +++++++++++++++++++++++--------------
1 file changed, 23 insertions(+), 14 deletions(-)
diff --git a/doc/storage-backends.md b/doc/storage-backends.md
index 30d2054..f5331fc 100644
--- a/doc/storage-backends.md
+++ b/doc/storage-backends.md
@@ -44,6 +44,12 @@ rsync is used to transfer the container content across.
lxc storage create pool1 dir
```
+* Use an existing directory for "pool2".
+
+```
+lxc storage create pool2 dir source=/data/lxd
+```
+
### Btrfs
- Uses a subvolume per container, image and snapshot, creating btrfs snapshots when creating a new object.
@@ -63,15 +69,12 @@ lxc storage create pool1 btrfs
lxc storage create pool1 btrfs source=/some/path
```
-
- Create a new pool called "pool1" on "/dev/sdX".
```
-lxc storage create pool1 zfs source=/dev/sdX
+lxc storage create pool1 btrfs source=/dev/sdX
```
-
-
### LVM
- Uses LVs for images, then LV snapshots for containers and container snapshots.
@@ -79,19 +82,25 @@ lxc storage create pool1 zfs source=/dev/sdX
#### The following commands can be used to create LVM storage pools
-- Use the existing volume group "my-pool"
+- Create a loop-backed pool named "pool1". The LVM Volume Group will also be called "pool1".
+
+```
+lxc storage create pool1 lvm
+```
+
+- Use the existing LVM Volume Group called "my-pool"
```
lxc storage create pool1 lvm source=my-pool
```
-- Create new pool named "pool1" on "/dev/sdX".
+- Create a new pool named "pool1" on "/dev/sdX". The LVM Volume Group will also be called "pool1".
```
lxc storage create pool1 lvm source=/dev/sdX
```
-- Create new pool on "/dev/sdX" with the volume group name "my-pool".
+- Create a new pool called "pool1" using "/dev/sdX" with the LVM Volume Group called "my-pool".
```
lxc storage create pool1 lvm source=/dev/sdX lvm.vg_name=my-pool
@@ -125,37 +134,37 @@ lxc storage create pool1 lvm source=/dev/sdX lvm.vg_name=my-pool
#### The following commands can be used to create ZFS storage pools
-- Create a loop-backed pool named "pool1".
+- Create a loop-backed pool named "pool1". The ZFS Zpool will also be called "pool1".
```
lxc storage create pool1 zfs
```
-- Create a loop-backed pool named "pool1" with the on-disk name "my-tank".
+- Create a loop-backed pool named "pool1" with the ZFS Zpool called "my-tank".
```
-lxc storage create pool1 zfs zfs.pool_name=my-tank
+lxc storage create pool1 zfs zfs.pool\_name=my-tank
```
-- Use the existing pool "my-tank".
+- Use the existing ZFS Zpool "my-tank".
```
lxc storage create pool1 zfs source=my-tank
```
-- Use the existing dataset "my-tank/slice".
+- Use the existing ZFS dataset "my-tank/slice".
```
lxc storage create pool1 zfs source=my-tank/slice
```
-- Create a new pool called "pool1" on "/dev/sdX".
+- Create a new pool called "pool1" on "/dev/sdX". The ZFS Zpool will also be called "pool1".
```
lxc storage create pool1 zfs source=/dev/sdX
```
-- Create a new pool on "/dev/sdX" with the on-disk name "my-tank".
+- Create a new pool on "/dev/sdX" with the ZFS Zpool called "my-tank".
```
lxc storage create pool1 zfs source=/dev/sdX zfs.pool_name=my-tank
More information about the lxc-devel
mailing list