Ubuntu12.04 OpenStack Folsom 安裝(VLAN模式)之一

當時因爲Quantum 還有很多BUG 網絡服務仍使用nova-network
 
整體規劃
 
各個主機都要有不同的主機名,openstack使用hostname區別內部的各個主機。
 
三臺主機:
control.test.com     控制節點
compute-01.test.com             計算節點
compute-02.test.com             計算節點
 
主機ip地址:

Control.test.com:

eth0: 192.168.3.164 /24(公網)      eht1:  192.168.4.164/24(私網)
compute-01.test.com:
eth0: 192.168.3.165/24(公網)     eth1:   192.168.4.165/24(私網)
compute-02.test.com:
eth0: 192.168.3.166/24(公網)     eth1:   192.168.4.166/24(私網)
       ………….
 
計算節點 保留eth1網口給虛擬機用

其中 192.168.3.0/24 作爲物理機IP段(可認爲是公網IP,)

192.168. 4.0/24 作爲物理機服務之間的通訊

192.168.3.168---192.168.3.190 作爲虛擬機 Floating_ip 段(分配給虛擬機,從外部可以直接訪問的,可以認爲是公網IP地址)

虛擬機網段規劃:
本次採用的是vlan模式,並且是多nova-network服務模式
虛擬機內整體網段:
10.100.0.0/24 , 再在此段上劃分出vlan段
劃分的三個vlan段:
10.100.0.0/24   vlan_id 2
 
虛擬機遷移:
配置nfs ,來做遷移

由於程序中會對共享目錄中的uid進行操作,所以需要nfs server 和client端的uid是一致的,至少必須不同主機之間nova用戶的uid是一致的,libvirt-bin用戶也要一致

所以用存儲服務器(192.168.3.166) 作爲nfs server

別的計算節點 作爲 client端

兩個計算節點之間測試遷移
 
虛擬機掛載額外磁盤:
openstack使用LVM來劃分磁盤,利用tgt + open_iscsi來實現局域網內磁盤設備的利用

現在我們提供磁盤的主機是存儲服務器(192.168.3.166),同時也是一個nfs server節點。

當要給虛擬機劃分磁盤時,首先利用lvm在ubuntu2劃分指定大小的一塊磁盤,然後利用tgt 服務,把磁盤聲明出去,運行目標虛擬機的物理主機會去找到這個盤,並登陸使用,分配給其上的虛擬機使用。
 
目前Folsom進入ubuntu 12.04的官方的源,不過需要你手工添加。

 

  1. cat <<EOF >>/etc/apt/sources.list 
  2. deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-proposed/folsom main 
  3. deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/folsom main 
  4. EOF 
運行下面命令

 

  1. apt-get install ubuntu-cloud-keyring 
  2. apt-get update 
Hostname設置

 

  1. cat /etc/hostname  
  2. control 
  3.  
  4. cat /etc/hosts 
  5. 127.0.0.1      localhost 
  6. 192.168.4.165     compute-01.test.com compute-01 
  7. 192.168.4.166     compute-02.test.com compute-02 
  8.  
  9. hostname 
  10. control 
  11.  
  12. hostname -f 
  13. control.test.com 
 
網絡
直接設置 /etc/network/interface

 

  1. auto lo 
  2. iface lo inet loopback 
  3.  
  4. auto eth0 
  5. iface eth0 inet static 
  6. address 192.168.3.164  
  7. netmask 255.255.255.0 
  8. gateway 192.168.3.1 
  9.  
  10. auto eth1 
  11. iface eth1 inet static 
  12. address 192.168.4.164 
  13. netmask 255.255.255.0 
重啓服務
  1. /etc/init.d/networking restart 
設置IP轉發

 

  1. sed -i -r 's/^\s*#(net\.ipv4\.ip_forward=1.*)/\1/' /etc/sysctl.conf 
  2. sysctl   -p 
一、安裝控制節點
安裝 NTP服務
編輯 /etc/ntp.conf ,在 server ntp.ubuntu.com 下添加兩行

 

  1. server ntp.ubuntu.com 
  2. server 127.127.1.0 
  3. fudge 127.127.1.0 stratum 10 
或者直接運行下面命令
  1. sed -i 's/server ntp.ubuntu.com/server ntp.ubuntu.com\nserver 127.127.1.0\nfudge 127.127.1.0 stratum 10/g' /etc/ntp.conf 
重啓NTP服務
 
  1. service ntp restart
安裝mysql
 
  1. apt-get -y install mysql-server python-mysqldb 
安裝時輸入mysql的root用戶密碼:root-pass
 
設置監聽Ip
  1. sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf 
重啓服務
  1. service mysql restart
創建數據庫

 

  1. mysql -uroot -proot-pass <<EOF 
  2. CREATE DATABASE nova; 
  3. GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'nova-pass'; 
  4. CREATE DATABASE glance; 
  5. GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'glance-pass'; 
  6. CREATE DATABASE keystone; 
  7. GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%'IDENTIFIED BY ' keystone-pass'; 
  8. CREATE DATABASE cinder; 
  9. GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%'IDENTIFIED BY 'cinder-pass'; 
  10. FLUSH PRIVILEGES; 
  11. EOF 
安裝RabbitMQ
 
  1. apt-get -y install rabbitmq-server 
把默認密碼 guest,改成rabbit-pass
  1. rabbitmqctl change_password guest rabbit-pass 
 
注意:如果hostname 和 hosts文件中主機名不相同服務無法啓動
 
安裝keystone
keystone 認證服務:openstack中各個組件之間傳遞消息,或者用戶對虛擬機的管理都要通過keystone認證,以保證某個請求是合法的
 
  1. apt-get install keystone python-keystone python-keystoneclient 
 
默認keystone使用sqlite ,改爲mysql, 刪除原來的數據庫文件
 
  1. rm /var/lib/keystone/keystone.db 
 

配置 /etc/keystone/keystone.conf

 

  1. [DEFAULT] 
  2. admin_token = 012345SECRET99TOKEN012345 
  3. bind_host = 0.0.0.0 
  4. public_port = 5000 
  5. admin_port = 35357 
  6. compute_port = 8774 
  7. verbose = True 
  8. debug = True 
  9. log_file = keystone.log 
  10. log_dir = /var/log/keystone 
  11. log_config = /etc/keystone/logging.conf 
  12. [sql] 
  13. connection = mysql://keystone:[email protected]:3306/keystone 
  14. idle_timeout = 200 
 
重啓服務和初始化數據庫
 
  1. service keystone restart 
  2. keystone-manage db_sync 
 
查看數據庫中是否創建了這些表,版本不一樣可能表也不一樣
 

 
配置tenant,user 和 role
tenant : 租戶,代替了原本的project的概念,一個tenant 應該是一個整個的工程,在這個tenant裏面可以創建user, 可以給這個user 配置role , 然後這個user 可以在這個 tenant 裏面創建虛擬機,配置安全組等
創建tenant
  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0 tenant-create --name openstackDemo --description "Default Tenant" --enabled true 
 

在這個tenant裏創建用戶 adminUser

  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0   user-create --tenant_id b5815b046cfe47bb891a7b64119e7f80 --name adminUser --pass secretword --enabled true 
 

 
創建默認角色 admin 和memberRole
 
  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0 role-create --name admin 
 


  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0 role-create --name memberRole 
 

 
給 openstackDemo tenant 裏的adminUser 賦予admin 權限
  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0 user-role-add --user_id a4c2d43f80a549a19864c89d759bb3fe   --tenant_id b5815b046cfe47bb891a7b64119e7f80 --role_id  e3d9d157cc95410ea45d23bbbc2e5c10 
這個命令沒有輸出,如果有多個tenant 的話要賦予權限給相應
 
創建一個Service tenant , 這個tenant裏包括所有的服務用戶
  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0 tenant-create --name service --description "Service Tenant" --enabled true 
 

 
在service tenant裏 創建 glance service 用戶
  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0 user-create --tenant_id eb7e0c10a99446cfa14c244374549e9d --name glance --pass glance --enabled true 
 

把 admin 角色賦予glance 服務用戶
  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0 user-role-add --user_id 46b2667a7807483d983e0b4037a1623b --tenant_id eb7e0c10a99446cfa14c244374549e9d --role_id e3d9d157cc95410ea45d23bbbc2e5c10 
這個命令沒有輸出
 
在service tenant 裏創建nova service 用戶
  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0   user-create --tenant_id eb7e0c10a99446cfa14c244374549e9d --name nova --pass nova --enabled true 
 

給nova服務用戶賦予 admin 角色
 
  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0   user-role-add --user_id 54b3776a8707834d983e0b4037b1345c    --tenant_id eb7e0c10a99446cfa14c244374549e9d --role_id e3d9d157cc95410ea45d23bbbc2e5c10 
 
在service tenant 裏創建ec2 服務用戶
  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0    user-create --tenant_id eb7e0c10a99446cfa14c244374549e9d --name   ec2 --pass ec2 --enabled true 
給ec2服務用戶賦予admin角色
  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0   user-role-add --user_id 32e7668b8707834d983e0b4037b1345c   --tenant_id eb7e0c10a99446cfa14c244374549e9d --role_id e3d9d157cc95410ea45d23bbbc2e5c10 
 
 
keystone 上定義service 端點: endpoint 
endpoint上定義了openstack 各個服務的 API endpoint (入口)
定義方式有兩種,
1,使用模板文件:
/etc/keystone/default_catalog.templates
2. 使用數據庫作爲後端
我們使用數據庫的方式配置endpoint
修改 /etc/keystone/keystone.conf 的 [catalog] 默認使用數據庫
 

如果使用模板文件,則修改爲:
 

 
創建keystone 服務 和 服務端點(service endpoints)
創建identity服務
  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0 service-create --name=keystone --type=identity --description="Keystone Identity Service" 
 

 


  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0   endpoint-create --region RegionOne --service_id=15c11a23667e427e91bc31335b45f4bd  --publicurl=http://192.168.4.164:5000/v2.0 --internalurl=http://192.168.4.164:5000/v2.0 --adminurl=http://192.168.4.164:35357/v2.0 
 

 
創建compute 服務 ,需要爲endpoint制定一個tenant
  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0 service-create --name=nova --type=compute --description="Nova Compute Service" 
 

 

  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0 endpoint-create --region RegionOne --service_id=abc0f03c02904c24abdcc3b7910e2eed --publicurl='http://192.168.4.164:8774/v2/%(tenant_id)s' --internalurl='http://192.168.4.164:8774/v2/%(tenant_id)s' --adminurl='http://192.168.4.164:8774/v2/%(tenant_id)s' 

 

 

定義volume service ,也需要制定 tenant

 

  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0 service-create  --name=volume  --type=volume  --description="Nova Volume Service" 
 

  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0 endpoint-create --region RegionOne --service_id=1ff4ece13c3e48d8a6461faebd9cd38f --publicurl='http://192.168.4.164:8776/v1/%(tenant_id)s' --internalurl='http://192.168.4.164:8776/v1/%(tenant_id)s' --adminurl='http://192.168.4.164:8776/v1/%(tenant_id)s'  
 

 
定義 p_w_picpath 服務
  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0 service-create --name=glance --type=p_w_picpath --description="Glance Image Service" 
 

  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0 endpoint-create --region RegionOne --service_id=7d5258c490144c8c92505267785327c1 --publicurl=http://192.168.4.165:9292/v1 --internalurl=http://192.168.4.165:9292/v1 --adminurl=http://192.168.4.165:9292/v1 
 
注意:如果glance服務從控制節點分開,命令中端口是9292的IP都要改成glance服務器的IP
 

 
定義EC2服務
  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0   service-create --name=ec2 --type=ec2  --description="EC2 Compatibility Layer" 
 


  1. keystone --token 012345SECRET99TOKEN012345 --endpoint http://192.168.4.164:35357/v2.0 endpoint-create --region RegionOne --service_id=181cdad1d1264387bcc411e1c6a6a5fd --publicurl=http://192.168.4.164:8773/services/Cloud --internalurl=http://192.168.4.164:8773/services/Cloud --adminurl=http://192.168.4.164:8773/services/Admin 
 

 
驗證認證服務的正確性

 

  1. sudo apt-get install curl openssl 
  2. curl -d '{"auth": {"tenantName": "adminTenant", "passwordCredentials":{"username": "adminUser", "password": "secretword"}}}' -H "Content-type:application/json" http://192.168.4.164:35357/v2.0/tokens | python -mjson.tool 
 
 
安裝glance服務
 
在存儲節點安裝鏡像服務器 (不一定要安裝在控制節點,可以單獨拿出一臺物理主機部署glance)如果分開的話要先安裝計算節點服務(sudo apt-get install nova-compute nova-network nova-api novnc)或先創建計算節點中所用到的賬戶,因爲nova會使用到計算節點的賬戶
  1. apt-get -y install glance glance-api python-glanceclient glance-common 
注意:如果glance服務和控制節點分開,必須在glance服務器安裝python-keystone模塊,否則glance服務無法啓動
刪掉默認的數據庫,因爲後面要配置mysql數據庫
  1. sudo rm /var/lib/glance/glance.sqlite 
 
配置
編輯/etc/glance/glance-api.conf 和 /etc/glance/glance-registry.conf

 

  1. sql_connection = mysql://glance:[email protected]/glance 
  2. auth_host = 192.168.4.164 
  3. admin_tenant_name = service 
  4. admin_user = glance 
  5. admin_password = glance-pass 
 
編輯 /etc/glance/glance-api.conf

 

  1. #notifier_strategy = noop 
  2. notifier_strategy = rabbit 
  3.  
  4. #rabbit_password = guest 
  5. rabbitrabbit_password = rabbit-pass 
 
運行下面命令
 
  1. cat <<EOF >>/etc/glance/glance-api.conf 
  2. flavor = keystone+cachemanagement 
  3. EOF 
  4.  
  5. cat <<EOF >>/etc/glance/glance-registry.conf 
  6. flavor = keystone 
  7. EOF 
 
重啓服務
  1. service glance-api restart && service glance-registry restart   
在ubuntu12.04 glance 數據表是在 version control 之下的,運行下面的步驟
如果glance服務和控制機分開的話要安裝python-mysqldb

 

  1. glance-manage version_control 0 
  2. glance-manage db_sync 
  3. sudo service glance-registry restart 
 
驗證glance
 
  1. glance --version 
 
 
獲取測試鏡像

 

  1. mkdir /tmp/p_w_picpaths 
  2. cd /tmp/p_w_picpaths/ 
  3.  
  4. wget http://smoser.brickies.net/ubuntu/ttylinux-uec/ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz
  5. tar -zxvf ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz

注意:上傳鏡像時,如果glance服務從控制節點分開,下面命令中的IP:127.0.0.1都要改成keystone服務器的IP(內網ip)
 
上傳kernel
  1. glance --os_username=adminUser --os_password=secretword --os_tenant=openstackDemo --os_auth_url=http://127.0.0.1:5000/v2.0 add name="tty-linux-kernel" disk_format=aki container_format=aki < ttylinux-uec-amd64-12.1_2.6.35-22_1-vmlinuz 
 

上傳initrd
  1. glance --os_username=adminUser --os_password=secretword --os_tenant=openstackDemo --os_auth_url=http://127.0.0.1:5000/v2.0 add name="tty-linux-ramdisk" disk_format=ari container_format=ari < ttylinux-uec-amd64-12.1_2.6.35-22_1-loader 
 

上傳鏡像
  1. glance --os_username=adminUser --os_password=secretword --os_tenant=openstackDemo --os_auth_url=http://127.0.0.1:5000/v2.0 add name="tty-linux" disk_format=ami container_format=ami kernel_id=599907ff-296d-4042-a671-d015e34317d2 ramdisk_id=7d9f0378-1640-4e43-8959-701f248d999d < ttylinux-uec-amd64-12.1_2.6.35-22_1.img 
 


  1. glance --os_username=adminUser --os_password=secretword --os_tenant=openstackDemo --os_auth_url=http://127.0.0.1:5000/v2.0  index 
 

 

上面的例子使用 --os_username, --os_password, --os_tenant, --os_auth_url ,也可以使用 OS_*環境變量

例如: vi openrc

 

  1. export OS_USERNAME=adminUser 
  2. export OS_TENANT_NAME=openstackDemo 
  3. export OS_PASSWORD=secretword 
  4. export OS_AUTH_URL=http://192.168.4.164:5000/v2.0/ 
  5. export OS_REGION_NAME=RegionOne 
 
安裝nova服務

 

  1. apt-get -y install nova-api nova-cert nova-common nova-scheduler python-nova python-novaclient nova-consoleauth novnc nova-novncproxy 
 
配置
編輯 /etc/nova/api-paste.ini

 

  1. auth_host = 192.168.4.164 
  2. auth_port = 35357 
  3. auth_protocol = http 
  4. admin_tenant_name = service 
  5. admin_user = nova 
  6. admin_password = nova 
 
編輯文件 /etc/nova/nova.conf  

 

  1. [DEFAULT] 
  2. logdir=/var/log/nova 
  3. state_path=/var/lib/nova 
  4. lock_path=/run/lock/nova 
  5. verbose=False 
  6. api_paste_config=/etc/nova/api-paste.ini 
  7. scheduler_driver=nova.scheduler.simple.SimpleScheduler 
  8. s3_host=192.168.4.164 
  9. ec2_host=192.168.4.164 
  10. ec2_dmz_host=192.168.4.164 
  11. rabbit_host=192.168.4.164 
  12. rabbitrabbit_password=rabbit-pass 
  13. cc_host=192.168.4.164 
  14. nova_url=http://192.168.4.164:8774/v1.1/ 
  15. sql_connection=mysql://nova:[email protected]/nova 
  16. ec2_url=http://192.168.4.164:8773/services/Cloud 
  17. root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf 
  18.   
  19. # Auth 
  20. use_deprecated_auth=false 
  21. auth_strategy=keystone 
  22. keystone_ec2_url=http://192.168.4.164:5000/v2.0/ec2tokens 
  23. # Imaging service 
  24. glance_api_servers=192.168.4.165:9292 
  25. p_w_picpath_service=nova.p_w_picpath.glance.GlanceImageService 
  26.   
  27. # Vnc configuration 
  28. novnc_enabled=true 
  29. novncproxy_base_url=http://0.0.0.0:6080/vnc_auto.html 
  30. novncproxy_port=6080 
  31. vncserver_proxyclient_address=0.0.0.0 
  32. vncserver_listen=0.0.0.0 
  33.   
  34. # Network settings 
  35. #network_api_class=nova.network.quantumv2.api.API 
  36. #quantum_url=http://192.168.4.164:9696 
  37. #quantum_auth_strategy=keystone 
  38. #quantum_admin_tenant_name=service 
  39. #quantumquantum_admin_username=quantum 
  40. #quantum_admin_password
  41. #quantum_admin_auth_url=http://192.168.4.164:35357/v2.0 
  42. #libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver 
  43. #linuxnet_interface_driver=nova.network.linux_net.LinuxOVSInterfaceDriver 
  44. #firewall_driver=nova.virt.libvirt.firewall.IptablesFirewallDriver 
  45.   
  46. ###### NETWORK 
  47. #network_manager=nova.network.manager.FlatDHCPManager 
  48. network_manager=nova.network.manager.VlanManager 
  49. force_dhcp_release=True 
  50. dhcpbridge_flagfile=/etc/nova/nova.conf 
  51. dhcpbridge=/usr/bin/nova-dhcpbridge 
  52. firewall_driver=nova.virt.libvirt.firewall.IptablesFirewallDriver 
  53. public_inter> 
  54. flat_inter> 
  55. vlan_inter> 
  56. flat_network_bridge=br100 
  57. fixed_range=10.100.0.0/24 
  58. multi_host=true 
  59.   
  60. # Compute # 
  61. #compute_driver=libvirt.LibvirtDriver 
  62.   
  63. ###### COMPUTE 
  64. libvirt_type=kvm 
  65. connection_type=libvirt 
  66. instanceinstance_name_template=instance-%08x 
  67. api_paste_config=/etc/nova/api-paste.ini 
  68. allow_resize_to_same_host=True 
  69. libvirt_use_virtio_for_bridges=true 
  70. start_guests_on_host_boot=true 
  71. resume_guests_state_on_host_boot=true 
  72.   
  73. # Cinder # 
  74. volume_api_class=nova.volume.cinder.API 
  75. osapi_volume_listen_port=5900 
 
創建nova數據表
 
  1. nova-manage db sync 
重啓服務

 

  1. service nova-api restart 
  2. service nova-cert restart 
  3. service nova-consoleauth restart 
  4. service nova-scheduler restart 
  5. service nova-novncproxy restart 
 
 
安裝cinder服務
在存儲節點安裝cinder服務

 

  1. apt-get install -y cinder-api cinder-scheduler cinder-volume  open-iscsi tgt python-cinderclient 
 
硬盤專門一個分區給volume使用

 

  1. pvcreate /dev/sda5 
  2. vgcreate cinder-volumes /dev/sda5 
 

編輯 /etc/cinder/cinder.conf ,直接運行下面命令就可以

  1. [DEFAULT] 
  2. rootwrap_config = /etc/cinder/rootwrap.conf 
  3. sql_connection = mysql://cinder:[email protected]:3306/cinder 
  4. api_paste_confg = /etc/cinder/api-paste.ini 
  5. iscsi_helper = ietadm 
  6. volume_group = cinder-volumes 
  7. volumevolume_name_template = volume-%s 
  8. rabbitrabbit_password = rabbit-pass 
  9. logdir = /var/log/cinder 
  10. verbose = False 
  11. auth_strategy = keystone 
 

編輯 /etc/cinder/api-paste.ini

 

  1.  admin_tenant_name = service 
  2. admin_user = cinder 
  3. admin_password = cinder 
 
同步數據庫
 
  1. cinder-manage db sync 
 
重啓服務

 

  1. service cinder-api restart 
  2. service cinder-scheduler restart 
  3. service cinder-volume restart 
 
nova 命令創建額外存儲

volume-attach       Attach a volume to a server.

    volume-create       Add a new volume.
    volume-delete       Remove a volume.
    volume-detach       Detach a volume from a server.
    volume-list         List all the volumes.
    volume-show         Show details about a volume.
創建
 

顯示volume
 

顯示虛擬機
 

掛載
 

顯示volume
 

掛好的顯示 in-use
卸載
 

顯示volume
 

 

 
進入虛擬機就會看到 /dev/下面多了個磁盤文件
 

Ubuntu12.04 OpenStack Folsom 安裝(VLAN模式)之二

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章