1. 程式人生 > >openstack常用命令

openstack常用命令

sina 啟動 deb public 創建 container rom 命名空間 float

共享鏡像 glance member-create fa47923c-2d3b-4d71-80cf-a047ba3bf342 eb3913b9ae5f41b09f2632389a1958d8
刪除共享鏡像 glance member-delete fa47923c-2d3b-4d71-80cf-a047ba3bf342 eb3913b9ae5f41b09f2632389a1958d8
列出私有鏡像 glance image-list --is-public=False
列出公有鏡像 glance image-list --is-public=True
鏡像刪除 glance image-delete 鏡像ID
鏡像上傳 glance image-create --name=centos_7.4_x64_globalegrow --is-public=True --container-format bare --disk-format raw --property cloudinit_updated=True --property can_live_resize=Yes --property os_type=linux --property os_name=centos --file=centos_7.4_x64.img
glance image-create --name "鏡像名字" --file 鏡像文件名字 --disk-format raw --container-format bare --is-public=False --property os_type=linux --property cloudinit_updated=True --owner 項目ID --progress
鏡像下載 glance image-download --file test_image f1bffb27-340f-4b0b-bd62-310b49e22c5b
查看所有雲主機 nova list --all
查看鏡像所有雲主機 nova list --image 5a34b656-ed38-4911-b494-82236f254a1b --all
查看某個項目下的所有雲主機 nova list --all|grep 1ee16a3fb843411eb7c8b1201bd182d8
查看命名空間 ip netns
查看實例 nova flavor-list
創建實例 nova flavor-create --vcpus 1 --ram 1024 --disk 5 ram_type_1_1G_5G
列出用戶 keystone user-list
列出租戶 keystone tenant-list
獲取ak sk keystone ec2-credentials-create --user-id 25b6d5fe34344e50a3c606e72deba23b --tenant-id ea1e8ebfb404454294ab16facb8ac287(項目ID)
查看單個實例的詳細信息 nova show 50b6f7d5-ca78-423d-81c1-ad7671e6c07f
查看實例的生命過程 nova instance-action-list 50b6f7d5-ca78-423d-81c1-ad7671e6c07f
查看浮動ip列表 neutron floatingip-list
鏡像格式轉換 qemu-img convert -f qcow2 -O raw CentOS-7.3_x64.qcow2 centOS-7.3_x64.raw
https://blog.csdn.net/sinat_32079337/article/details/70245700 升級桌面
更改雲主機狀態、重啟雲主機 for i in `nova list --all --host compute23 | grep ERROR | awk ‘{print $2}‘`;do echo $i;nova reset-state $i;sleep 3;nova reboot $i --hard;done

在用U盤裝完CentOS後,重新開機啟動後顯示:
Initial setup of CentOS Linux 7 (core)
1) [x] Creat user 2) [!] License information
(no user will be created) (license not accepted)
Please make your choice from above [‘q’ to quit | ‘c’ to continue | ‘r’ to refresh]:
解決方法:
輸入“1”,按Enter鍵
輸入“2”,按Enter鍵
輸入“q”,按Enter鍵
輸入“yes”,按Enter鍵
也就是出現如下情況。

openstack常用命令