Posts tagged Linux
Common Issues – No Networking on new OpenVZ VPS
0Hello all,
Today I ran into an interesting issue where a VPS had no networking either inbound or outbound after setup. This is the error that would present when restarting network via init.d:
Bringing up interface venet0: SIOCADDRT: Network is unreachable SIOCADDRT: Network is unreachable
This issue also presented in that cPanel licenses could not activate not could any ping or host commands work properly. I eventually narrowed down the issue to the fact that the IPs that had been added to the VPS were not properly set to ARP by checking with the following command (run on the node):
arp | grep [INSERT IP HERE]
In order to resolve this, all I needed to do was add the arp entries for the IPs on the actual virtual environment by running the following commands on the node:
arp -s [INSERT IP HERE] `ifconfig eth0 | grep eth0 | awk '{print $5}'` pub
Make sure you run the command above for every IP on the VPS. This resolved the issue and all networking started working again properly.
Total Memory on a Xen Node
2I ran into an interesting issue the other day that I figured I’d make a post about in order for others. Since my company is getting more into Xen Hosting, I’ve tried to be at the forefront of the virtualization software for the company. We did run into an interesting issue though the other day when it came to determining the total amount of memory on a hardware node. Since we set up the Domain-0 to use only 512MB of memory, we were having a tough time determining how much total RAM is in the server. After googling for awhile and asking some co-workers, I discovered the following command:
xm info
This command shows quite a few interesting metrics including the total memory for the server. Using this I was able to easily discern the total amount of memory and write a quick script to compute total amount of memory:
1 2 3 4 5 6 7 8 9 10 | #!/bin/bash total_memory=$(xm info | grep total_memory | awk '{print $3}') remaining=$(xm info | grep free_memory | awk '{print $3 - 512}') used_memory=$((total_memory-remaining)) echo -e 'Total Memory:\t'$total_memory'MB ('$((total_memory/1024))'GB)' echo -e 'Memory Used:\t'$used_memory'MB ('$((used_memory/1024))'GB)' echo -e 'Remaining:\t'$remaining'MB ('$((remaining/1024))'GB)' |
Hope this helps anyone else trying to figure out accurate Xen Memory usage