Wednesday, April 3, 2019

Oracle Linux 6 -- How to Create and Start a Linux Container

Problem

You want to create Linux Containers for Oracle RAC Database installation.

Solution

Use the Oracle Linux (lxc-oracle) LXC template to create a container:

# lxc-create -n racnode1 -B btrfs -t oracle -- --release=6.latest
Host is OracleServer 6.10
Create configuration file /container/racnode1/config
Yum installing release 6.latest for x86_64
Loaded plugins: security, ulninfo
Setting up Install Process
.
.
.
Complete!
Rebuilding rpm database
Patching container rootfs /container/racnode1/rootfs for Oracle Linux 6.10
Configuring container for Oracle Linux 6.10
Added container user:root password:root
Container : /container/racnode1/rootfs
Config    : /container/racnode1/config
Network   : eth0 (veth) on lxcbr0

Check with brctl show that  lxcbr0 is created. If not created then create it manually with brctl addbr lxcbr0 otherwise the container will fail to start.

# brctl show
bridge name     bridge id               STP enabled     interfaces
virbr0          8000.5254005aedff       yes             virbr0-nic

# brctl addbr lxcbr0
# brctl show
bridge name     bridge id               STP enabled     interfaces
lxcbr0          8000.000000000000       no
virbr0          8000.5254005aedff       yes             virbr0-nic

Start the container racnode1 as a daemon:

lxc-start -n racnode1 -d -o /container/ol6ctr1_debug.log -l DEBUG

No comments: