Rsyncing /vz/private to other OVZ6 node, how?

Discussion in 'Questions and Answers' started by ICPH, Aug 1, 2017.

  1. ICPH

    ICPH Member

    166
    2
    Aug 24, 2013
    Hello,

    i have tried to rsync one OpenVZ 6 VPS from node server to another using rsync:

    rsync -Pavz /node1/vz/private/3710 /vz/private/3710
    rsync -avz /node1/etc/vz/conf/3710 /etc/vz/conf/3710

    but when tried to start destination VPS, i faced issues with TTy, /dev/null error. And others so i resigned to the rsync way.

    Were You successful to rsync OpenVZ VPS by rsyncing private? What is needed to make it working?
     
  2. Aldryic C'boas

    Aldryic C'boas The Pony

    2,313
    2,651
    Apr 18, 2013
    Aldryic
    You should be using vzctl <ctid> migrate, not just manually copying files.
     
    ICPH likes this.
  3. ICPH

    ICPH Member

    166
    2
    Aug 24, 2013
    Thx, this seems not to work when need to migrate from OpenVZ6 to OpenVZ7 (Virtuozzo). I tried https://openvz.org/Upgrade_script_from_OpenVZ_to_Virtuozzo_7 but it was extremely slow and not finished properly in numerous cases. So i was thinking about /private rsync way..
     
  4. Aldryic C'boas

    Aldryic C'boas The Pony

    2,313
    2,651
    Apr 18, 2013
    Aldryic
    What I'd suggest then is creating an OS template and deploying that. Trying to manually copy OVZ containers just typically ends in tragedy - best case scenario, you end up with a ton of extra work trying to find all of the little things you missed along the way just to get the thing to boot.
     
    ICPH likes this.
  5. ICPH

    ICPH Member

    166
    2
    Aug 24, 2013
    I used HyperVM to create ostemplate, that one worked to be restored into new CT @ OpenVZ 6 by vzctl, but at OpenVZ 7 the result is:

    # vzctl --verbose create 1000 --ostemplate centos-6-x86-CT1120 --config basic
    running: /usr/sbin/vzpkg info -q --config ve-basic.conf-sample --ostemplate centos-6-x86-CT1120 --vefstype ext4
    Error: Nothing to do
    Error: Nothing to do
    Error: Failed to install the template(s):
    Error: centos-6-x86-CT1120-ez
    Error: centos-6-x86-CT1120-x86_64-ez
    Error: Failed to convert the precreated cache /vz/template/cache/centos-6-x86-CT1120.tar.gz
    Error: Unable to find ostemplate: centos-6-x86-CT1120
    # ls -l /vz/template/cache/centos-6-x86-CT1120.tar.gz
    -rw-r--r-- 1 root root 764520763 Aug 4 15:18 /vz/template/cache/centos-6-x86-CT1120.tar.gz

    OpenVZ 7 using prlctl to create template so i am unsure about template compatibility between VZ v. 6 and v. 7.
     
  6. coreyman

    coreyman Active Member Verified Provider

    344
    48
    May 15, 2013
    What about vzdump and vzrestore, do those work on ovz7?
     
  7. ICPH

    ICPH Member

    166
    2
    Aug 24, 2013
    no, these does not work on VZ7 from what i tried.
    /etc/init.d/vz: No such file or directory
    Error: OpenVZ is not running on the target machine
    "consider switching to pmigrate utility"
     
  8. coreyman

    coreyman Active Member Verified Provider

    344
    48
    May 15, 2013