Openstack-based iscsi mounting, disk and Virtual Machine resizing Test

Source: Internet
Author: User


Terms and abbreviations: OpenStack is an IaaS (Infrastructure as a service) component. It is a cloud platform management project and is not a software, this project is composed of several major components to complete some specific work. IP-based SAN technology -- ISCSI
Iscsi initiator is a software or hardware device installed on a computer. It communicates with iscsi storage devices. Iscsi target can use the software to allocate the storage space of the server to the client, and the client can use the iscsi disk like a local hard disk. Basic Environment: www.2cto.com Target server host: 10.1.200.175; Operating System: Ubuntu 12.04 Initator client host: 10.1.6.222; Operating System: ubuntu 12.04 and the machine has deployed an openstack environment (here we will not talk about the openstack construction process. If you are interested, the ECS will be updated later). The iscsi Mount Based on openstack: www.2cto.com target server configuration: Install software: apt-get install iscsitarget-dkms is not started by default after installation. Modify/etc/default/iscsitarget 1ISCSITARGET_ENABLE = true # Change false to true to restart the service/etc/init. d/iscsitarget restart create lvm logical volume 100G volume name lvtaomee volume group vgtaomee Modify/etc/iet/ietd. conf file, which defines the exported storage device 1 Target iqn.2012-10. taomee: storage2Lun 0 Path =/dev/vgtaomee/lvtaomee, Type = fileio start service/etc/init. d/iscsitarget start * Starting iSCSI enterprise target service
Initator client configuration: install software: apt-get install open-iscsi start service/etc/init. d/open-iscsi start discover what storage resources are available on the server: root @ ubuntu :~ # Iscsiadm-m discovery-t sendtargets-p 10.1.200.175: 326010.1.200.175: 3260,1 iqn.2012-10. taomee: storage www.2cto.com
Log on to the Mount server storage resource: root @ ubuntu :~ # Iscsiadm-m node -- targetname iqn.2012-10. taomee: storage -- loginLoggingin to [iface: default, target: iqn.2012-10. taomee: storage, portal: 10.1.200.175, 3260] Loginto [iface: default, target: iqn.2012-10. taomee: storage, portal: 10.1.200.175, 3260]: successful view mounting information: query the Target content in the database: # iscsiadm-m node if you want to delete: root @ ubuntu :~ # Iscsiadm-m node -- op delete -- targetname iqn.2012-10. taomee: If storage reports an error, run/etc/init. d/open-iscsi restart and then fdisk-l, we can see that all the attached iscsi disks have been detached www.2cto.com and used Openstack to create virtual machines: because all the components of openstatck are deployed on the same machine 10.1.6.222, by default, the lvm has been created for the VM disk. : If you want to use Openstack to create a virtual machine, the disk size is 260 GB, and the current allocable size is only 200 GB. Therefore, add the device/dev/sdb mounted by iscsi to lvm. # Pvcreate/dev/sdb # vgextend nova-volumes/dev/sdb www.2cto.com
Use openstack to create a virtual machine (vm_ubuntu) and create a GB volume for mounting to the virtual machine. Log on to the VM to view the disk and resize the VM. Openstack has allocated GB of disk space to the VM, with 40 GB of space remaining. Assume that the VM still needs 70 GB of space. In this case, you need to export a device from the target server and add it to the volume group to resize the disk. Target server configuration: Create lvm logical volume 40 Gb volume name lvtest volume group vgtaomee Modify/etc/iet/ietd. conf file, which defines the exported storage device 1 Target iqn.2012-10. taomee: test2Lun 0 Path =/dev/vgtaomee/lvtest, Type = fileio startup service/etc/init. d/iscsitarget start
Initator client configuration: root @ ubuntu :~ # Iscsiadm-m discovery-t sendtargets-p 10.1.200.175: 326010.1.200.175: 3260,1 iqn.2012-10. taomee: testroot @ ubuntu :~ # Iscsiadm-m node -- targetname iqn.2012-10. taomee: test -- loginLogging in to [iface: default, target: iqn.2012-10. taomee: test, portal: 10.1.200.175, 3260] Login to [iface: default, target: iqn.2012-10. taomee: test, portal: 10.1.200.175, 3260]: successful view disk mount: www.2cto.com
Add the disk to the volume group # pvcreate/dev/sdc # vgextend nova-volumes/dev/sdcOpenstack. the disk volume has been expanded to 340 GB and 260 GB has just been used, you can allocate 70 GB of volume space to resize the Virtual Machine disk. View Virtual Machine mounting: You can partition and format the mounting.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.