[lxc-users] Moving storage volumes to new pool

187 views
Skip to first unread message

Joshua Schaeffer

unread,
Jan 20, 2021, 3:28:18 PM1/20/21
to lxc-...@lists.linuxcontainers.org
I'm running LXD 3.03 on Ubuntu 18.04 and the backend for my main storage pool is starting to fail. I have a drive that is provided via SAN to my LXD server and the SAN server itself needs to be shutdown and refreshed. I wanted to move my container's storage volumes from my original storage to a new ceph storage pool, but I'm clearly not specifying my move command properly:

lxcuser@lxcserver:~$ lxc storage list
+------------+-------------+--------+---------+---------+
|    NAME    | DESCRIPTION | DRIVER |  STATE  | USED BY |
+------------+-------------+--------+---------+---------+
| btrfspool1 |             | btrfs  | CREATED | 21      |
+------------+-------------+--------+---------+---------+
| cephpool1  |             | ceph   | CREATED | 0       |
+------------+-------------+--------+---------+---------+


lxcuser@lxcserver:~$ lxc storage volume list btrfspool1
+----------------------+------------------------------------------------------------------+-------------+---------+-----------+
|         TYPE         |                               NAME                               | DESCRIPTION | USED BY | LOCATION  |
+----------------------+------------------------------------------------------------------+-------------+---------+-----------+
| container            | bllweb05                                                         |             | 1       | lxcserver |
+----------------------+------------------------------------------------------------------+-------------+---------+-----------+

lxcuser@lxcserver
:~$ lxc storage volume move btrfspool1/bllweb05 cephpool1/bllweb05
Error: not found


How are you supposed to specify the move command to move a volume from one storage pool to another?
-- 
Thanks,
Joshua Schaeffer

Brian Candler

unread,
Apr 21, 2021, 11:38:23 AM4/21/21
to lxc-users, jscha...@harmonywave.com
I see this too (Ubuntu 18.04, lxd 4.13 from snap)

root@nuc1:~# lxc storage volume list default | grep jocko
| container | jocko                                                            |             | filesystem   | 1       |
root@nuc1:~# lxc storage volume move default/jocko plain/jocko --debug
...
DBUG[04-21|16:23:46] Sending request to LXD                   method=GET url=http://unix.socket/1.0/storage-pools/default/volumes/custom/jocko etag=
Error: not found

Now, checking the API, this URL is of the form /1.0/storage-pools/<pool>/volumes/<type>/<name>

Therefore it appears that the "lxc storage volume move" command only works for volumes of type "custom", not "container".  AFAICT, "custom" volumes are ones created separately to attach to a container for additional data storage:

root@nuc1:~# lxc storage volume list default | grep wibble
| custom    | wibble                                                           |             | filesystem   | 0       |
root@nuc1:~# lxc storage volume move default/wibble plain/wibble
Storage volume moved successfully!
root@nuc1:~# lxc storage volume list plain | grep wibble
| custom | wibble |             | filesystem   | 0       |
root@nuc1:~# lxc storage volume delete plain wibble
Storage volume wibble deleted

A quick google finds that the way to move container storage is to use "lxc move", not "lxc storage volume move":

root@nuc1:~# lxc move jocko jocko -s plain
<<< "top" shows rsync processes running >>>
root@nuc1:~# lxc storage volume list plain | grep jocko
| container | jocko |             | filesystem   | 1       |

(Note: older versions of lxd may require renaming, see here)

Joshua Schaeffer

unread,
Apr 21, 2021, 12:13:29 PM4/21/21
to lxc-users


On 4/21/21 9:38 AM, Brian Candler wrote:
Therefore it appears that the "lxc storage volume move" command only works for volumes of type "custom", not "container".  AFAICT, "custom" volumes are ones created separately to attach to a container for additional data storage:
I guess I never updated the list, but this was the conclusion I came to as well. As Gunnar suggested I simply moved the container instead of the volume. In my particular case I had to first upgrade from 3.x to 4.x which was pretty seamless.

-- 
Thanks,
Joshua Schaeffer
Reply all
Reply to author
Forward
0 new messages