Network LVM-storage

From ISPWiki
Jump to: navigation, search
Hierarchy: VMmanager KVM -> Cluster configuration
VMmanager Cloud -> Cluster configuration

A network LVM-storage is similar to a common lvm except for the following details. However the physical volume where a group of volumes is located, is a network device (for example, a disk connected through the iSCSI protocol)

Peculiarities

When creating a virtual machine, on the same cluster node a virtual disk is created, and it will be accessible on all the cluster node. It will be active only on one node.

When migrating a virtual machine, the virtual disk will not copy, but will activate on the target node. On the source node, the disk will be disabled.

Example of configuration using open-iscsi

Network storage configuration

  • Install iSCSI:
# yum install scsi-target-utils
  • Configure lvm:
# pvcreate /dev/sda2
  Physical volume "/dev/sda2" successfully created
# vgcreate vg0 /dev/sda2
  Volume group "vg0" successfully created
  • Configure the tgtd file:
# cat /etc/tgt/targets.conf
...
<target iqn.2014-04.net.ispsystem.nlvm:storage.nlvm>
  backing-store /dev/sda2
  initiator-address 10.1.1.1 #IP address of cluster node
  initiator-address 10.1.1.2
  initiator-address 10.1.1.3
</target>
...


# service tgtd restart
Stopping SCSI target daemon:                               [  OK  ] 
Starting SCSI target daemon:                               [  OK  ]
  • Add iptables rules if needed:
iptables -I INPUT 1 -p tcp --dport 3260 -j ACCEPT
service iptables save

Connecting to cluster nodes

  • Connect the disk on each cluster node
iscsiadm -m discovery -t st -p 10.1.2.1 
iscsiadm -m node --login -p 10.1.2.1

Once completed you can add a "network LVM" storage named vg0 into VMmanager.