Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


OpenVZ taking ages to assign an IP to a container
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

OpenVZ taking ages to assign an IP to a container

MrAndroidMrAndroid Member
edited April 2012 in General

Hey,

Im using "vzctl set --ipadd --save" to add an IP address to a container, however once I do it it takes roughly two mins to finally return.

However, around 5 seconds after i've entered it, I can look at vzlist and enter the VPS and notice that its fine and its assigned it, so I am wondering why vzctl is taking ages to return the function after its done it?

Comments

  • FranciscoFrancisco Top Host, Host Rep, Veteran

    run it through an strace :)

    It's quite possible it's waiting on processes to finish reloading/etc to bind the address. If you got NAMED running, i've seen it hang pretty bad.

  • @Francisco said: run it through an strace :)

    It's quite possible it's waiting on processes to finish reloading/etc to bind the address. If you got NAMED running, i've seen it hang pretty bad.

    Ok i'll give it a go, its not a major issue, its just going to be a pain to implement in my scripts however.

  • Why does @Naruto Thank every post of yours?

  • @DanielM said: Why does @Naruto Thank every post of yours?

    Don't know

    Heres the strace output, it was pretty fast this time though

    http://pastebin.com/q4wm0KJL

  • Try strace -t next time, please :) Or strace -tt

  • Ok, I think I've fixed it.

    However, is it me or do the CentOS templates off the OpenVZ website not have a /etc/network/interfaces file? The debian ones doo.

  • For CentOS it is /etc/sysconfig/network-scripts/ifcfg* instead

  • @rds100 said: For CentOS it is /etc/sysconfig/network-scripts/ifcfg* instead

    Then why does OpenVZ spit in this error and the VPSs don't have network on CentOS

    Adding IP address(es): 173.208.252.195
    /bin/bash: line 494: /etc/network/interfaces: No such file or directory
    grep: /etc/network/interfaces: No such file or directory
    /bin/bash: line 507: /etc/network/interfaces: No such file or directory
    /bin/bash: line 530: /etc/network/interfaces: No such file or directory
    /bin/bash: line 537: /etc/network/interfaces: No such file or directory
    cp: cannot stat `/etc/network/interfaces': No such file or directory
    /bin/bash: line 561: /etc/network/interfaces.bak: No such file or directory
    mv: cannot stat `/etc/network/interfaces.bak': No such file or directory
    Setting CPU units: 1000
    Container start in progress...
    
  • CentOS networking is handled through the files in /etc/sysconfig/network-scripts/, ifcfg-eth0 in particular. They like being difficult like that :P

  • @Daniel something is wrong with your vzctl. There is /etc/vz/dists/*.conf and /etc/vz/dists/scripts/ which makes vzctl behave in a different way (i.e. touch different files) depending on the distribution of the container.

  • @rds100 said: @Daniel something is wrong with your vzctl. There is /etc/vz/dists/*.conf and /etc/vz/dists/scripts/ which makes vzctl behave in a different way (i.e. touch different files) depending on the distribution of the container.

    I think I'm missing CentOS then

    [root@kc scripts]# ls -1
    arch-add_ip.sh
    arch-del_ip.sh
    arch-set_hostname.sh
    arch-set_ugid_quota.sh
    debian-3.x-add_ip.sh
    debian-add_ip.sh
    debian-del_ip.sh
    debian-set_hostname.sh
    etcnet-add_ip.sh
    etcnet-del_ip.sh
    functions
    funtoo-add_ip.sh
    funtoo-del_ip.sh
    funtoo-set_dns.sh
    gentoo-add_ip.sh
    gentoo-del_ip.sh
    gentoo-set_hostname.sh
    gentoo-set_ugid_quota.sh
    postcreate.sh
    redhat-7.x_add_ip.sh
    redhat-add_ip.sh
    redhat-del_ip.sh
    redhat-set_hostname.sh
    set_dns.sh
    set_ugid_quota.sh
    set_userpass.sh
    slackware-9.x_add_ip.sh
    slackware-9.x_del_ip.sh
    slackware-add_ip.sh
    slackware-del_ip.sh
    slackware-set_hostname.sh
    slackware-set_ugid_quota.sh
    suse-7.x_add_ip.sh
    suse-8.x_add_ip.sh
    suse-8.x_del_ip.sh
    suse-add_ip.sh
    suse-del_ip.sh
    suse-set_hostname.sh
    
  • rds100rds100 Member
    edited April 2012

    For CentOS it is redhat-add_ip.sh
    Byt see in the /etc/vz/dists/ if there is a corresponding centos.conf
    Also what exactly is the template name of that container?
    i.e. grep OSTEMPLATE /etc/vz/conf/XXX.conf

  • MrAndroidMrAndroid Member
    edited April 2012

    Yes there is a centos.conf

    ADD_IP=redhat-add_ip.sh
    DEL_IP=redhat-del_ip.sh
    SET_HOSTNAME=redhat-set_hostname.sh
    SET_DNS=set_dns.sh
    SET_USERPASS=set_userpass.sh
    SET_UGID_QUOTA=set_ugid_quota.sh
    POST_CREATE=postcreate.sh
    

    Template name is centos-6-x86_64.tar.gz

  • I've noticed that the VPSs configuration file still contains the old template,

  • rds100rds100 Member
    edited April 2012

    This is very strange because according to your strace vzctl thinks that this is a debian 6 VPS, see this line:


    stat("/etc/vz/dists/debian-6.0-x86_64.conf", 0x7fffa4b0c460) = -1 ENOENT (No such file or directory)

    So it executes the scripts for debian VPS.

  • I've noticed that the VPSs configuration file still contains the old template,

    Edit it then, change OSTEMPLATE to centos-6-x86_64 and this should fix it.

  • Ok, I just gotta make a script that automates it

  • Stupid me, I forgot you can set --ostemplate with vzctl set, and I had just finished the sed command.

  • debugdebug Member

    @DanielM said: Why does @Naruto Thank every post of yours?

    His signature is literally "Thanked by (1): Naruto.". If his post was really thanked, there wouldn't be a


    Above it. (Unless there is a signature, which then it's below the signature)

    Thanked by 1MrAndroid
  • @debug said: His signature is literally "Thanked by (1): Naruto.". If his post was really thanked, there wouldn't be a

    Wasen't Naruto mant to be unbanned, I miss him.

    Thanked by 1NateN34
  • @Daniel said: Wasen't Naruto mant to be unbanned, I miss him.

    Perhaps the reason why he keeps Thanking you. Best give @Chief a nudge

  • Unbanned!!!! wow...

  • @DanielM said: Best give @Chief a nudge

    "Last Active April 2"
    Looks like Chief isn't showing up again lol

  • InfinityInfinity Member, Host Rep

    @DanielM That's @Daniels sig if you didn't notice..

  • @Infinity said: @DanielM That's @Daniels sig if you didn't notice..

    Ahhh

Sign In or Register to comment.