Page 1 of 1

Help with Virtuozzo 4 vzmlocal command

Posted: Mon Jun 11, 2012 7:57 pm
by KrazyBob
I am trying to move a container to a new number on the same server and I don't understand the command. The bottom line is that I don't understand the instructions. I simply want to move 101 to 1001 using Virtuozzo 4. I appreciate any help. Thank you in advance.

I don't understand /my_dir and /ct111 because ct111 is not how the node is referenced. It is referenced as /vz/private/101 or /vz/root/101

Code: Select all

Moving Container Within Hardware Node

The vzmlocal utility allows you to move Containers within your Hardware Node. Moving a Container within one and the same Hardware Node consists in changing the Container ID and its private area and root paths. So, you may use vzmlocal to change the ID of the corresponding Container only or to additionally modify its private area and root path.

Let us assume that you wish to change the ID of your Container from 101 to 111 and modify its private area and root paths from /vz/private/101 to /vz/private[b]/my_dir[/b] and from /vz/root/101 to /vz/root[b]/ct111[/b], respectively. To this effect, you should execute the following command on the Hardware Node:

# vzmlocal 101:111:/vz/private/my_dir:/vz/root/ct111

Moving/copying Container#101 -> Container#111,

[/vz/private/my_dir], [/vz/root/ct111] ...

...

Successfully completed

Code: Select all

[root@hw006 ~]# vzmlocal 101:1001:/vz/private/101:/vz/root/1001  
Moving/copying CT#101 -> CT#1001, [/vz/private/101], [/vz/root/1001] ...
OfflineManagement CT#101 ...
done
Stopping CT#101 ...
vzctl : Failed to run vzquota off for Container 101 [11]
/usr/sbin/vzctl exited with code 66
can not stop/umount CT#101 : /usr/sbin/vzctl exited with code 66
Can't move/copy CT#101 -> CT#1001, [/vz/private/101], [/vz/root/1001] : can not stop/umount CT#101 : /usr/sbin/vzctl exited with code 66

Re: Help with Virtuozzo 4 vzmlocal command

Posted: Wed Jun 13, 2012 1:18 pm
by paulie
My experience is from Virtuozzo 4.7 and doesn't amount to much but what I can tell you is that the stupid command won't work on running containers!

And I think you only need to specify the second set of parameters (from/to directories) if you're using non-standard paths. Certainly when I've cloned containers I've never bothered to specify it.

Re: Help with Virtuozzo 4 vzmlocal command

Posted: Wed Jun 13, 2012 3:11 pm
by faris
Yeah, Paulie's right:

Code: Select all

vzmlocal oldID:newID


...will change the countainer's ID. There's no need for the additional stuff.

From the manual: "Specifying the destination Container private area path (<dest_private>) and
root path (<dest_root>) is optional; it allows you to override the default paths."

Also from the manual: "You may run the vzmlocal utility on both running and stopped Containers" but I'm with Paulie on this -- I'd stop the container first!!!

Re: Help with Virtuozzo 4 vzmlocal command

Posted: Wed Jun 13, 2012 3:13 pm
by KrazyBob
You know, I knew there was a simple way! Why can't the Russians right in plain English :)

Re: Help with Virtuozzo 4 vzmlocal command

Posted: Wed Jun 13, 2012 4:32 pm
by faris
:-) I know what you mean.

Re: Help with Virtuozzo 4 vzmlocal command

Posted: Thu Jun 14, 2012 3:52 pm
by paulie
But if they did it'd all be too easy!