trying to move a container to different storage.

garnish

New Member
Jan 21, 2017
2
0
1
53
My 'local' storage pool was filling up and I discovered I wasn't using the LVM storage so I created a new storage called "local-lvm" and set it to "Container, Disk Image"... Then I shut down the first container I wanted to move (#102).

Not seeing an option to move it in the GUI (as one would move a VM), I figured I'd turn to google and saw many references to 'vzdump' and 'vzrestore'... Turns out there's no 'vzrestore' executable so those instructions must be outdated.

After some more googling, I determined that I need to:
mv /var/lib/vz/images/102 /mnt/pve/images/
pct set 102 -rootfs local-lvm:102/vm-102-disk-1.raw,size=18G
pct start 102
The last step fails however, so now I'm not sure what to do:
lxc-start: tools/lxc_start.c: main: 365 The container failed to start.
lxc-start: tools/lxc_start.c: main: 367 To get more details, run the container in foreground mode.
lxc-start: tools/lxc_start.c: main: 369 Additional information can be obtained by setting the --logfile and --logpriority options.
command 'lxc-start -n 102' failed: exit code 1

So I played with lxc-start and it looks like it's unhappy with the storage name "local-lvm":

root@pve:/mnt/pve/images/102# lxc-start -n 102 -F --logfile=/tmp/foo --logpriority=debug
lvm name '102/vm-102-disk-1.raw' contains illegal characters
lxc-start: conf.c: run_buffer: 347 Script exited with status 25
lxc-start: start.c: lxc_init: 450 Failed to run lxc.hook.pre-start for container "102".
lxc-start: start.c: __lxc_start: 1313 Failed to initialize container "102".
lxc-start: tools/lxc_start.c: main: 365 The container failed to start.
lxc-start: tools/lxc_start.c: main: 369 Additional information can be obtained by setting the --logfile and --logpriority options.

Prior to 'pct set', my config looked like:

arch: amd64
cores: 2
hostname: harvester
memory: 2048
net0: name=eth0,bridge=vmbr0,hwaddr=92:E1:BB:EC:3D:49,ip=dhcp,type=veth
onboot: 1
ostype: ubuntu
rootfs: local:102/vm-102-disk-1.raw,size=18G
swap: 2048

After 'pct set', my config looks like:

arch: amd64
cores: 2
hostname: harvester
memory: 2048
net0: name=eth0,bridge=vmbr0,hwaddr=92:E1:BB:EC:3D:49,ip=dhcp,type=veth
onboot: 1
ostype: ubuntu
rootfs: local-lvm:102/vm-102-disk-1.raw,size=18G
swap: 2048

Anyone know what's actually going on?
 
Nevermind. I figured it out minutes after posting this. I had created the storage pool incorrectly.

I created an 'lvm' storage pool in /mnt/pve.

Instead, I created a 'dir' storage pool in /mnt/pve/containers and moved /var/lib/vz/images/102 to /mnt/pve/containers/images/102, edited /etc/pve/lxc/102.conf and set "rootfs: local-containers:102/vm-102-disk-1.raw,size=18G"

(I was going to delete my original post but can't see a way to do that)