moving containers

Discussion in 'General Discussion' started by jmackenz, May 2, 2013.

  1. jmackenz

    jmackenz Kilo Poster

    Messages:
    17
    hello :)

    I'm running virtuozzo-release-4.6.0-187 on Centos 5.3 64bit

    I got a new box, running centos 6 64bit, and intend on migrating my containers to this box.

    They will not be retaining the same IP addresses.

    What procedure would I follow to make this transition as painless as possible? I will be completing this move within the next 30 days.

    Thanks for reading :)
     
  2. KristianM

    KristianM Product Expert

    Messages:
    469
    Hi,

    what is exacly your question?
    Not quite sure. :)

    I would proceed as follows:

    - Schedule a maintenance
    - reduce TTL for affected Domains in DNS to something like 300
    - Shutdown CT one by one and do the following:
    - vzmigrate
    - change IP in DNS for affected Domains
    - vzctl set $CTID --ipdel all --ipadd $NEWIP --save
    - vzctl set $CTID --nameserver $NEWNSIP --save
    - vzctl start $CTID

    If you have Plesk running inside the CTs then you will have to enter the CT and do the following:

    - vzctl enter $CTID
    - # /usr/local/psa/bin/reconfigurator.pl remap
    - Edit "remap-File
    - # /usr/local/psa/bin/reconfigurator.pl remap
    - Exit CT
    - Inform Customer that his CT is up and running again

    Regards,
    Kristian
     
  3. jmackenz

    jmackenz Kilo Poster

    Messages:
    17
    I was led to believe that things often don't go that smoothly?

     
  4. KristianM

    KristianM Product Expert

    Messages:
    469
    Hi,

    well basicly there is one thing you have to add, which is syncing the template area.
    I missed that one as it's fully automated here as I wrote a wrapper around vzmigrate to do this.

    As you are running VZ 4.6 most probably in SLM Mode, I would not expect for it to be a problem to move towards vSwap.
    By default VZ 4.7 should just map your config to vSwap. Though it is of course better to just set the primary parameters new.
    e.g. "vzctl set $CTID --ram ${X}G --swap ${Y}G --save"

    Obviously you should be doing test migrations before starting with the Live migrations.
    Maybe I would even suggest not moving to VZ 4.7 but rather move directly to PCS6.

    If you have any further questions, don't hesitate to ask.

    Regards,
    Kristian

    btw. the above quote looks like it could be from Faris :)
     
  5. Faris Raouf

    Faris Raouf Product Expert

    Messages:
    817
    Good guess :)
     
  6. jmackenz

    jmackenz Kilo Poster

    Messages:
    17
    figured I'd post this here just in case....

    doing my test migration, I moved ct103 to the new node.

    I changed the ip, ns , and set ram as described above to 1gb ram/1gb swap (I also tested with 2g/2gb)
    vzctl set 103 --ram 1G --swap 1G --save


    it used to be 1gb on old node. (vzctl set 103 --slmmemorylimit 1024M --slmmode slm --diskspace 10G --save)


    when I try to start the SimpleHelp server, I get this message :


    Error occurred during initialization of VM
    Could not reserve enough space for object heap
    Could not create the Java virtual machine.
     
    Last edited: May 24, 2013
  7. KristianM

    KristianM Product Expert

    Messages:
    469
    Hi,

    while running Java within CTs, please do make sure you set more than one CPU for the CT.

    Regards,
    Kristian
     
  8. jmackenz

    jmackenz Kilo Poster

    Messages:
    17
    currently it says not limited, node shows 2
     
  9. jmackenz

    jmackenz Kilo Poster

    Messages:
    17
    appears it was inode related, I set it to not limited and jre launched
    guess I should see what it's using now and adjust limits.
     
  10. KristianM

    KristianM Product Expert

    Messages:
    469
    Hi,

    well, I'm glad to hear you solved the issue.

    Regards,
    Kristian
     
  11. jmackenz

    jmackenz Kilo Poster

    Messages:
    17
    HELP :)

    So... I cloned my most critical container before moving it. then migrated it to the new host.

    it migrated, and started, but when I logged in to do the plesk remap mysql was not running (nor were many other services) so the remap command could not function.

     
    Last edited: May 25, 2013
  12. jmackenz

    jmackenz Kilo Poster

    Messages:
    17
    I got the test migration functional. Should I destroy it and start with a fresh migration or can I backup the original, move the backup, do a backup sync, and restore over the test.?
     
  13. KristianM

    KristianM Product Expert

    Messages:
    469
    Hi,

    to have a fully functional and consistent migration, I would destroy and start over.
    But it's actually your choice :)

    Regards,
    Kristian
     
  14. jmackenz

    jmackenz Kilo Poster

    Messages:
    17
    I destroyed it and re-migrated... now I can't get the container to start.....


    [root@daenerys ~]# vzctl set 102 --ram 6G --swap 2G --save
    Saved parameters for Container 102
    [root@daenerys ~]# free -m
    total used free shared buffers cached
    Mem: 11867 3851 8016 0 1261 1345
    -/+ buffers/cache: 1243 10623
    Swap: 4095 0 4095
    [root@daenerys ~]# vzctl start 102
    Starting the Container ...
    Container is mounted
    Warning: NUMIPTENT 0:0 is less than the minimum allowed value; the value is set to 16:16
    fork() failed: Cannot allocate memory
    Error: Unable to start the Container
    Container is unmounted
    Failed to start the Container


    Is there some general formula to follow when setting up container resources....?
     
  15. jmackenz

    jmackenz Kilo Poster

    Messages:
    17
    this doesn't look right....

    Code:
    [root@daenerys ~]# cat /proc/user_beancounters
    Version: 2.5
           uid  resource                     held              maxheld              barrier                limit              failcnt
           50:  kmemsize                 27610966             28844032  9223372036854775807  9223372036854775807                    0
                lockedpages                     0                    0               524288               524288                    0
                privvmpages                100999               102746              1179648              1179648                    0
                shmpages                      259                  259  9223372036854775807  9223372036854775807                    0
                dummy                           0                    0  9223372036854775807  9223372036854775807                    0
                numproc                        73                   96  9223372036854775807  9223372036854775807                    0
                physpages                   54352                57624               524288               524288                    0
                vmguarpages                     0                    0               786432               786432                    0
                oomguarpages                20088                20088               524288               524288                    0
                numtcpsock                     42                   42  9223372036854775807  9223372036854775807                    0
                numflock                        6                    6  9223372036854775807  9223372036854775807                    0
                numpty                          0                    0  9223372036854775807  9223372036854775807                    0
                numsiginfo                      0                   21  9223372036854775807  9223372036854775807                    0
                tcpsndbuf                  738096               738096  9223372036854775807  9223372036854775807                    0
                tcprcvbuf                 4231192              4231192  9223372036854775807  9223372036854775807                    0
                othersockbuf               166928               166928  9223372036854775807  9223372036854775807                    0
                dgramrcvbuf                     0                    0  9223372036854775807  9223372036854775807                    0
                numothersock                  159                  159  9223372036854775807  9223372036854775807                    0
                dcachesize                2001196              2102802  9223372036854775807  9223372036854775807                    0
                numfile                      1063                 1145  9223372036854775807  9223372036854775807                    0
                dummy                           0                    0  9223372036854775807  9223372036854775807                    0
                dummy                           0                    0  9223372036854775807  9223372036854775807                    0
                dummy                           0                    0  9223372036854775807  9223372036854775807                    0
                numiptent                      10                   10  9223372036854775807  9223372036854775807                    0
          103:  kmemsize                  4398932              5636096  9223372036854775807  9223372036854775807                    0
                lockedpages                     0                    0  9223372036854775807  9223372036854775807                    0
                privvmpages                  2340                 4454  9223372036854775807  9223372036854775807                    0
                shmpages                        1                    1  9223372036854775807  9223372036854775807                    0
                dummy                           0                    0  9223372036854775807  9223372036854775807                    0
                numproc                        12                   45  9223372036854775807  9223372036854775807                    0
                physpages                    4481                 7771               524288               524288                    0
                vmguarpages                     0                    0  9223372036854775807  9223372036854775807                    0
                oomguarpages                 1224                 1224  9223372036854775807  9223372036854775807                    0
                numtcpsock                      2                    2  9223372036854775807  9223372036854775807                    0
                numflock                        5                    5  9223372036854775807  9223372036854775807                    0
                numpty                          0                    0  9223372036854775807  9223372036854775807                    0
                numsiginfo                      0                   33  9223372036854775807  9223372036854775807                    0
                tcpsndbuf                   34880                34880  9223372036854775807  9223372036854775807                    0
                tcprcvbuf                   32768                32768  9223372036854775807  9223372036854775807                    0
                othersockbuf                 2312                 3600  9223372036854775807  9223372036854775807                    0
                dgramrcvbuf                     0                    0  9223372036854775807  9223372036854775807                    0
                numothersock                   83                   83  9223372036854775807  9223372036854775807                    0
                dcachesize                2371412              2495092  9223372036854775807  9223372036854775807                    0
                numfile                       361                  435  9223372036854775807  9223372036854775807                    0
                dummy                           0                    0  9223372036854775807  9223372036854775807                    0
                dummy                           0                    0  9223372036854775807  9223372036854775807                    0
                dummy                           0                    0  9223372036854775807  9223372036854775807                    0
                numiptent                      10                   10  9223372036854775807  9223372036854775807                    0
       
     
  16. jmackenz

    jmackenz Kilo Poster

    Messages:
    17
    continued... :)

     
  17. Faris Raouf

    Faris Raouf Product Expert

    Messages:
    817
    I don't know about the dummy dummy stuff, but at a guess what's happening is that you are getting some **** in your config file for the container. I had all sorts of bother with this.

    Those large numbers, by the way, can represent "unlimited".

    What you need is a nice, clean conf file for the container, containing the minimum amount of stuff. for example, what might be happening is that numiptent has been set to 0 when really it needs a higher value, or no entry at all in the config.

    take a look at some of the vswap sample configs and use those as the basis for your container.
     
  18. jmackenz

    jmackenz Kilo Poster

    Messages:
    17
    great advice Faris (as usual) , worked like a charm :)
     
  19. jmackenz

    jmackenz Kilo Poster

    Messages:
    17
    so, I copied that conf, destroyed the container, re-migrated , applied the conf, restarted... it's running.

    I do the remap.

    I go to log in to the panel, and instead of the usual screen , I see a vzpp log in to plesk 11.0.9 , and it doesn't take my original credentials.

    Ideas?
     
  20. jmackenz

    jmackenz Kilo Poster

    Messages:
    17
    found this, it worked

    vzctl set CT_ID --offline_management yes --offline_service vzpp --save
     

Share This Page