reduxio solution for kvm€¦ · sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder...
Post on 01-May-2018
287 Views
Preview:
TRANSCRIPT
ifconfig
ip link
sudo ifconfig NETWORK_ADAPTER_NAME up
sudo ifconfig eth1 up
ip link
sudo ifconfig NETWORK_ADAPTER_NAME REQUESTED_IP netmask NETMASK
sudo ifconfig eth1 10.17.56.207 netmask 255.0.0.0
ifconfig
/etc/network/interfaces
auto lo NETWORK_ADAPTER_NAME
iface lo inet loopback
iface NETWORK_ADAPTER_NAME inet static
address IP_ADDRESS
netmask NETMASK
# Second Network Adapter
auto lo eth1
iface lo inet loopback
iface eth1 inet static
address 10.17.56.207
netmask 255.0.0.0
sudo apt-get -y install open-iscsi open-iscsi-utils multipath-
tools lsscsi
/etc/iscsi/iscsid.conf
node.startup = automatic
node.session.timeo.replacement_timeout = 10
node.conn[0].timeo.login_timeout = 15
node.conn[0].timeo.logout_timeout = 15
node.conn[0].timeo.noop_out_interval = 5
node.conn[0].timeo.noop_out_timeout = 5
node.session.initial_login_retry_max 8
node.session.err_timeo.lu_reset_timeout = 300
node.session.err_timeo.tgt_reset_timeout = 300
/etc/udev/rules.d/99-reduxio.rules
SUBSYSTEM=="block" , ACTION=="change", ATTRS{model}=="TCAS",
ATTRS{vendor}=="REDUXIO", RUN+="/bin/sh -c
'/usr/sbin/iscsiadm -m session -R '"
SUBSYSTEM=="block" , ACTION=="change", ATTRS{model}=="TCAS",
ATTRS{vendor}=="REDUXIO", ATTR{size}=="0",
RUN+="/bin/sh -c 'echo 1 > /sys$DEVPATH/../../delete '"
/etc/multipath.conf
devices {
device {
vendor "REDUXIO"
product "TCAS"
revision "2300"
path_grouping_policy "group_by_prio"
path_checker "tur"
hardware_handler "1 alua"
prio "alua"
failback "immediate"
features "0"
rr_weight "uniform"
path_selector "round-robin 0"
no_path_retry "72"
rr_min_io_rq 10
rr_min_io 10
user_friendly_names "yes"
fast_io_fail_tmo "10" # wait up to 10 seconds before failing
io.
}
}
blacklist {
# Note: it is highly recommended to blacklist by wwid or
vendor instead of device name
devnode "^sd[a]$"
}
sudo /etc/init.d/open-iscsi restart
sudo /etc/init.d/multipath-tools restart
sudo cat /etc/iscsi/initiatorname.iscsi
sudo iscsiadm --mode discovery -t st -p 10.46.216.22 -l
sudo iscsiadm -m node -T iqn.2013-
12.com.reduxio:af4032f0003a000e -p 10.46.216.22 -o update -n
node.startup -v automatic
[sudo] password for idit:
sudo iscsiadm -m node -T iqn.2013-
12.com.reduxio:af4032f0003a000e -p 10.46.216.11 -o update -n
node.startup -v automatic
sudo iscsiadm -m node -T iqn.2013-
12.com.reduxio:af4032f0003a000e -p 10.64.216.11 -o update -n
node.startup -v automatic
sudo iscsiadm -m node -T iqn.2013-
12.com.reduxio:af4032f0003a000e -p 10.64.216.22 -o update -n
node.startup -v automatic
sudo multipathd show config
# grep mpt /sys/class/scsi_host/host?/proc_name /sys/class/scsi_host/host2/proc_name:mptspi
# sudo bash # echo "- - -" > /sys/class/scsi_host/host2/scan
root@ubuntu:~# ls /dev/sd* /dev/sda /dev/sda1 /dev/sda2 /dev/sda5
idit@ubuntu:~$ ls /dev/sd* /dev/sda /dev/sda1 /dev/sda2 /dev/sda5 /dev/sdb
sudo lshw -C disk
sudo fdisk /dev/sdb
Command (m for help): m Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only) Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended
Select (default p): p Partition number (1-4, default 1): 1 First sector (2048-629145599, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-629145599, default 629145599): Using default value 629145599 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.
idit@ubuntu:~$ ls /dev/sd* /dev/sda /dev/sda1 /dev/sda2 /dev/sda5 /dev/sdb /dev/sdb1
Sudo mkfs.ext4 /dev/sdb1
sudo mkdir /media/kvm/vol1
Sudo blkid
/dev/sdb1: UUID="89cff11c-a2cb-4e59-a053-de013b06bcd4" TYPE="ext4"
/etc/fstab
Sudo /etc/fstab
# egrep -c '(vmx|svm)' /proc/cpuinfo
If 0 it means that your CPU doesn't support hardware virtualization.
If 1 or more it does - but you still need to make sure that virtualization is enabled in the BIOS.
# kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
# egrep -c '(vmx|svm)' /proc/cpuinfo
If 0 it means that your CPU doesn't support hardware virtualization.
If 1 or more it does - but you still need to make sure that virtualization is enabled in the BIOS.
sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
grep kvm /etc/group
kvm:x:112:
grep libvirtd /etc/group
libvirtd:x:113:idit
sudo adduser `id -un` kvm
sudo adduser `id -un` libvirtd
Adding user '<username>' to group 'libvirtd' ...
# sudo vim /etc/network/interfaces
# The loopback network interface auto lo iface lo inet loopback # virbr0 interface auto virbr0 iface virbr0 inet dhcp bridge_ports eth0 bridge_stp off bridge_fd 0 bridge_maxwait 0 # virbr1 interface auto virbr1 iface virbr1 inet static address 10.17.56.207 netmask 255.0.0.0 bridge_ports eth1 bridge_stp off bridge_maxwait 0
# sudo /etc/init.d/networking restart
# sudo reboot
# brctl show
# sudo vim /etc/network/interfaces
# The loopback network interface auto lo iface lo inet loopback # virbr0 interface auto virbr0 iface virbr0 inet static address 172.18.3.104 netmask 255.255.0.0 gateway 172.18.0.1 bridge_ports eth0 bridge_stp off
bridge_fd 0 bridge_maxwait 0 # virbr1 interface auto virbr1 iface virbr1 inet static address 10.17.56.207 netmask 255.0.0.0 bridge_ports eth1 bridge_stp off bridge_maxwait 0
# sudo /etc/init.d/networking restart
# sudo reboot
# brctl show
# sudo apt-get install nfs-common
# sudo mkdir /media/iso
# sudo mount -t nfs NFS_SERVER:/SHARE /NFS_EXPORT_PATH
# sudo mount -t nfs 172.17.32.68:/storage/install /media/iso
# mount
172.17.32.68:/storage/install on /media/iso type nfs (rw,vers=4,addr=172.17.32.68,clientaddr=172.18.3.104)
/etc/fstab
# sudo vim /etc/fstab
<nfs-server-IP>:/ /mnt nfs auto 0 0
# sudo chmod 777 /media/kvm/vol1
# sudo apt-get install cifs-utils
# sudo mkdir /media/iso
# sudo mount -t cifs -o username=USERNAME,password=PAASWORD //CIFS_SERVER:/SHARE /CIFS_EXPORT_PATH
# sudo mount -t cifs -o username=idit,password=passwd 172.17.32.68:/storage/install /media/iso
# mount
/etc/fstab
# sudo vim /etc/fstab
//<nfs-server-IP>:/ /mnt cifs username=YOURUSERNAME,password=YOURPASSWORD,iocharset=utf8,file_mode=0777,dir_mode=0777
o
# sudo apt-get update
# sudo apt-get install Ubuntu-desktop
# sudo apt-get install virt-manager
# sudo apt-get install qemu-system
top related