Monday, July 4, 2016

APF over Ubuntu 14.04



Ubuntu 14.04 with new kernel (Linux cloud 4.2.0-27-generic) is not supported by APF, so we have to hardcode (/etc/apf/internals/functions.apf) again as follow:


if [ "$KREL" == "2.4" ]; then
        MEXT="o"
elif [ "$KREL" == "2.6" ]; then
        MEXT="ko"
elif [[ "$KREL" =~ "3." ]]; then
        MEXT="ko"
elif [[ "$KREL" =~ "4." ]]; then
        MEXT="ko"
elif [ ! "$KREL" == "2.4" ] && [ ! "$KREL" == "2.6" ] && [[ ! "$KREL" =~ "3." ]]; then
        if [ ! "$SET_VERBOSE" == "1" ]; then
                echo "kernel version not compatible or netfilter support missing, aborting."
        fi
        eout "{glob} kernel version not compatible or netfilter support missing, aborting."
        exit 1
else
        if [ ! "$SET_VERBOSE" == "1" ]; then
                echo "kernel version not compatible or netfilter support missing, aborting."
        fi
        eout "{glob} kernel version not compatible or netfilter support missing, aborting."
        exit 1
fi


Saturday, October 3, 2015

OVA files over PROXMOX

Maybe you need to load an *.OVA file into proxmox, so you can do the following:



1.- Download (anywhere) the OVA file: (I use wget)
root@cdn32gw:/OVAfile# wget http://dl.l2lk3.net/download/VM/Cor8-DEMO-1.0.ova

2.- Untar downloaded file to get the VMDK (hdd) file:

root@cdn32gw:/OVAfile# tar -xvf Cor8-DEMO-1.0.ova

3.- Format disk container to QCOM2

root@cdn32gw:/OVAfile# qemu-img convert -f vmdk Cor8-DEMO-1.0-disk1.vmdk -O qcow2 newdisk.qcow2
Finally my files are:
root@cdn32gw:/OVAfile# ls -l 
-rw-r--r-- 1 root root 6460932096 Oct  3 newdisk.qcow2
-rw-r--r-- 1 root root 3433728000 May 21 Cor8-DEMO-1.0.ova
-rw------- 1 root root 3433705472 May 20 Cor8-DEMO-1.0-disk1.vmdk
-rw------- 1 root root      12311 May 20 Cor8-DEMO-1.0.ovf


4.- Review *.ovf file containing some VM's parameters in order to create a brand new VM with those same features inside PROXMOX (by using Web GUI)

---> Debian_64
Debian_64 
2 virtual CPU
2048 MB of memory
ideController0 
Ethernet adapter on 'Bridged'
E1000



5.- Create a VM inside Proxmox (as usual)

Note: Harddisk have to be QEMU


This is mine:




6.- Replace brand new harddisk with the *.vmdk (downloaded and formated to Qcow2)

root@cdn32gw:/OVAfile# mv newdisk.qcow2 /var/lib/vz/images/500/vm-500-disk-1.qcow2


7.- Start VM and have fun!


Friday, October 2, 2015

MYSQL Table is marked as crashed - HOWTO

Today I found a:

"mysqldump: Got error: 145: Table is marked as crashed and should be repaired when using LOCK TABLES"

Just do this:


1.-Log into Mysql:

[root@webapp html]# mysql -uroot -p

2.-Change to DB with the issue:
mysql> use LiveDB;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

3.-Check and repair:
mysql> check table bad_table;
+-------------------------------+-------+----------+-----------------------------                                                         --------------------------+
| Table                         | Op    | Msg_type | Msg_text                                                                                                       |
+-------------------------------+-------+----------+-----------------------------                                                         --------------------------+
| LiveDB.bad_table | check | warning  | Table is marked as crashed                                                                                     |
| LiveDB.bad_table | check | error    | Size of datafile is: 507904                                                                  Should be: 507968 |
| LiveDB.bad_table | check | error    | Corrupt                                                                                                        |
+-------------------------------+-------+----------+-----------------------------                                                         --------------------------+
3 rows in set (0.00 sec)

mysql> repair table bad_table;
+-------------------------------+--------+----------+----------+
| Table                         | Op     | Msg_type | Msg_text |
+-------------------------------+--------+----------+----------+
| LiveDB.bad_table | repair | status   | OK       |
+-------------------------------+--------+----------+----------+
1 row in set (0.18 sec)

mysql> quit;

Thursday, September 17, 2015

Proxmox 3.4-6 IPV6 Networking - Kernel issues


Only if you couldn't get IPv6 connectivity with your Proxmox host as related in prior post (Can be review here), some kernel fixes have to be applied.

1.- Check you kernel version

My server is using 2.6.32-39:
root@server:~# uname -a 
Linux server 2.6.32-39-pve #1 SMP Fri May 8 11:27:35 CEST 2015 x86_64 GNU/Linux

2.- Check Proxmox kernel version
root@server:~# pveversion -v
proxmox-ve-2.6.32: 3.4-156 (running kernel: 2.6.32-39-pve) 
pve-manager: 3.4-6 (running version: 3.4-6/102d4547) 
pve-kernel-2.6.32-39-pve: 2.6.32-156 


3.-  Verify kernel patchs officially published on: Patchs

You shoud install kernel patch to reach at least "pve-kernel-2.6.32 (2.6.32-149)"
that includes an IPv6 neighborhood detection fix correcting IPv6 operation:

* IPv6: forwaring ICMP6 neighbor solicitation on bridge


Available kernels:
[   ]pve-kernel-2.6.32-38-pve_2.6.32-155.changelog07-May-2015 08:1334K
[   ]pve-kernel-2.6.32-38-pve_2.6.32-155_amd64.deb07-May-2015 08:0935M
[   ]pve-kernel-2.6.32-39-pve_2.6.32-156.changelog12-May-2015 06:2634K
[   ]pve-kernel-2.6.32-39-pve_2.6.32-156_amd64.deb02-Jun-2015 16:3235M
[   ]pve-kernel-2.6.32-39-pve_2.6.32-157.changelog24-Jun-2015 10:1934K
[   ]pve-kernel-2.6.32-39-pve_2.6.32-157_amd64.deb26-Jun-2015 18:3535M
[   ]pve-kernel-2.6.32-40-pve_2.6.32-159.changelog27-Jul-2015 11:4635K
[   ]pve-kernel-2.6.32-40-pve_2.6.32-159_amd64.deb30-Jul-2015 12:2835M
[   ]pve-kernel-2.6.32-40-pve_2.6.32-160.changelog31-Jul-2015 07:0935K
[   ]pve-kernel-2.6.32-40-pve_2.6.32-160_amd64.deb08-Aug-2015 16:1835M
[   ]pve-kernel-2.6.32-41-pve_2.6.32-162.changelog14-Sep-2015 11:2735K
[   ]pve-kernel-2.6.32-41-pve_2.6.32-162_amd64.deb14-Sep-2015 11:2635M
[   ]pve-kernel-2.6.32-41-pve_2.6.32-163.changelog15-Sep-2015 14:0335K
[   ]pve-kernel-2.6.32-41-pve_2.6.32-163_amd64.deb15-Sep-2015 14:0135M

3.-  If your installed kernel is older than pve-kernel-2.6.32 (2.6.32-149), you have to apply patch.

In most of the cases apt-get update && apt-get dist-upgrade do the job, else try this: (example only)
root@server:~# wget http://download.proxmox.com/debian/dists/wheezy/pvetest/binary-amd64/pve-kernel-2.6.32-39-pve_2.6.32-149_amd64.deb

Install
root@server:~# dpkg -i pve-kernel-2.6.32-39-pve_2.6.32-157_amd64.deb