Вы находитесь на странице: 1из 53

Linux cloud termin9

8.6. 2015.
Virtualizacija

Kernel-based Virtual Machine

VmWare ESX
CentOs 6.6 i ESX 5.1

OpenNebula na:
CentOs 6.6 (Front-end)
ESX 5.1 (node)

Front-end OpenNebula servis


Nodovi se koriste za virt. maine.
CentOs 6.6 i ESX 5.1
CentOs 6.6 - Frontend

Dodavanje repozitorijuma i instalacija paketa:


# yum install epel-release
# cat << EOT > /etc/yum.repos.d/opennebula.repo
[opennebula]
name=opennebula
baseurl=http://downloads.opennebula.org/repo/4.8/CentOS/6/x86_64/
enabled=1
gpgcheck=0
EOT

# yum install nfs-utils nfs-utils-lib libvirt


# yum install opennebula-server opennebula-sunstone
CentOs 6.6 - Frontend

UID i GID korisnika oneadmin:


id oneadmin
uid=9869(oneadmin) gid=9869(oneadmin) * kao port

Potrebno je iskljuiti SELinux.


# nano /etc/sysconfig/selinux
...
SELINUX=disabled
...
# setenforce 0
# getenforce
Permissive

# /usr/share/one/install_gems (podrka za ruby)


Promena lozinke korisnika oneadmin:
# passwd oneadmin

Promena korisnika:
# su oneadmin
NFS konfiguracija

# nano /etc/exports
/var/lib/one/datastores/0 *(rw,sync,no_subtree_check,root_squash,anonuid=9869,anongid=9869)
/var/lib/one/datastores/1 *(rw,sync,no_subtree_check,root_squash,anonuid=9869,anongid=9869)

# service iptables stop


# service rpcbind start
# service nfs start - pokretanje nfs servisa
# exportfs -a
ESX 5.1 (node) i vmWare vSphere Client
ESX 5.1 (node) i vmWare vSphere Client
Dodavanje korisnika oneadmin sa
uid,gid 9869

ID oneadmin korisnika mora biti kao na Frontend-u


Dodavanje korisnika sa uid,gid 9869
Dodavanje privilegija korisniku oneadmin
add oneadmin Administrator
oneadmin - Administrator
SSH pristup
Configuration Security Profile Services Properties
SSH pristup
Options Start and stop with host Start
SSH pristup

FrontEnd: prijaviti se kao oneadmin


$ ssh-keygen
Enter an empty passphrase
$ cat .ssh/id_rsa.pub
$ ssh onedamin@192.168.119.137 (u novom terminalu)
ESX (u novom terminalu) :
# mkdir /etc/ssh/keys-oneadmin
# chmod 755 /etc/ssh/keys-oneadmin
# vi /etc/ssh/keys-oneadmin/authorized_keys ne postoji nano
i kopirati sadraj /var/lib/one/.ssh/id_rsa.pub sa FrontEnd-a
# chown oneadmin /etc/ssh/keys-oneadmin/authorized_keys
# chmod 600 /etc/ssh/keys-oneadmin/authorized_keys
# chmod +s /sbin/vmkfstools /bin/vim-cmd
Prvo prijavljivanje u novom terminalu

Vi editor Esc :wq (save and quit)


:q! (quit) ...
SSH prijava bez lozinke
samo oneadmin ne unosi lozinku!
Omoguavanje NFS clienta na ESX-u
NFS client - ESX
Spajanje (mount) skladita podataka
Configuration Storage Add Storage Network file system
Spajanje 0 i 1 (system i image)
primer za 0:
/var/lib/one/datastores/0
/var/lib/one/datastores/1
Konfiguracija VNC - Virtual Network Computing

VNC je grafiki deljeni sistem za upravljanje udaljenim raunarima.

Pomou ssh izvriti na ESX-u:


# cd /etc/vmware
# chown -R root firewall/
# chmod 7777 firewall/
# cd firewall/
# chmod 7777 service.xml

# vi /etc/vmware/firewall/service.xml (xml fajl )


/etc/vmware/firewall/service.xml

id=0033 prvi slobodan broj


Osveavanje firewall-a:

# /sbin/esxcli network firewall refresh


# /sbin/esxcli network firewall ruleset list
OpenNebula konfigurisanje (Frontend)

# nano /etc/one/oned.conf
Ukloniti oznaku za poetak komentara u sledeim linijama:
DATASTORE_LOCATION = /vmfs/volumes
DATASTORE_BASE_PATH = /vmfs/volumes
IM_MAD = [
name = "vmware",
executable = "one_im_sh",
arguments = "-c -t 15 -r 0 vmware" ]
VM_MAD = [
name = "vmware",
executable = "one_vmm_sh",
arguments = "-t 15 -r 0 vmware -s sh",
default = "vmm_exec/vmm_exec_vmware.conf",
type = "vmware]
Sunstone konfigurisanje (Frontend)

# nano /etc/one/sunstone-server.conf

# Server Configuration
#
:host: 0.0.0.0
:port: 9869
Frontend
# nano /etc/one/vmwarerc

# Username i lozinka za ESX


:username: "oneadmin"
:password: "password" password uneta lozinka
OpenNebula - Pokretanje

# service opennebula start


# service opennebula-sunstone start
Dodavanje ESX-a

$ onedatastore chmod 1 644

$ onehost create 192.168.119.137 -i vmware -v vmware -n dummy

Dodavanje i listanje korisnika:


$ oneuser create user [password] (man oneuser)
$ oneuser list
Dodavanje i listanje korisnika:
$ oneuser create user [password] (man oneuser)
$ oneuser list
Pokretanje

U browser-u uneti:
http://@IP-adresa-front-end@:9869

Lozinka korisnika oneadmin:


$ cat /var/lib/one/.one/one_auth
Sunstone
Datastores podeavanje

Infrastructure Datastores
Datastore 0
Datastore 1
Datastores
Marketplace ttylinux (import)
Marketplace ttylinux (import)
Virtual Resources Images
Template
Virtual Resources Template + Advanced mode
Dodavanje VM

Virtual Resources Virtual Machines


Virtual Machines
prelazak iz statusa PENDING > RUNNING
Virtual Machines
ttyLinux
ttyLinux
Vie VM-a
U sluaju dve VM, u terminalu:
vSphere Client