常用命令-openstack

openstack compute service list

openstack network agent list



#控制节点  启动服务
systemctl restart openstack-nova-api.service \
  openstack-nova-consoleauth.service openstack-nova-scheduler.service \
  openstack-nova-conductor.service openstack-nova-novncproxy.service
  
  systemctl restart neutron-server.service \
  neutron-linuxbridge-agent.service neutron-dhcp-agent.service \
  neutron-metadata-agent.service

##计算节点执行
systemctl restart libvirtd.service openstack-nova-compute.service neutron-linuxbridge-agent.service


uuid冲突


compute节点掉线处理问题可能1:

use nova_api;

select uuid,name from resource_providers where name='compute1';   # 旧uuid,需要更新
select uuid,host from nova.compute_nodes where host='compute1';   # 新uuid

update resource_providers set uuid='9beb6f98-8a24-406f-9060-7c82899666ce' where  uuid='c17d3c1f-fd55-4a32-9bbf-580afce21a9e';



虚拟机起不来
compute日志错误:qemu-kvm: cannot set up guest memory 'pc.ram': Cannot allocate memory

sysctl -a | grep overcommit

sysctl vm.overcommit_memory=1






#镜像下载


  glance image-download --file /root/online/centos6.5.qcow2        cef8dd32-65fd-4d0f-a917-3aa2d67f0b00  
  glance image-download --file /root/online/centos7.2.qcow2        8c946d88-d43f-4b0b-8b29-de71a7932894  
  glance image-download --file /root/online/centos7.4.qcow2        dcbb0bdf-2f38-4a99-ad10-1052a8e44709  
  glance image-download --file /root/online/centos7.4test.qcow2    b9fb31b4-3b62-4ca3-b357-91727ea9c639  
  glance image-download --file /root/online/chengguan.qcow2        e799be51-cf83-4395-b79f-fe77bbf74eee  
  glance image-download --file /root/online/cirros.qcow2           b7eae9c3-8cdb-4266-a65f-ebc992c94f38  
  glance image-download --file /root/online/custom.qcow2           dd4d46fb-dbdd-4e5f-80e7-fdf481a0371d  
  glance image-download --file /root/online/Desktop.qcow2          e78f0f4d-6c6c-4b19-b112-a3b3e71be11f  
  glance image-download --file /root/online/dianshang.qcow2        f36943aa-a492-42a1-a189-fb16b7262db7  
  glance image-download --file /root/online/elasticsearch.qcow2    e8959357-5dcf-4660-86c7-6f0fe198a06f  
  glance image-download --file /root/online/guangfu.qcow2          6cee543a-8a33-4292-bb3e-dec17bcd3ef5  
  glance image-download --file /root/online/hadoop.qcow2           31062393-9745-4e66-b75d-f69aad083379  
  glance image-download --file /root/online/hbase.qcow2            c7809182-9394-4e6b-9845-456fea6cf9d2  
  glance image-download --file /root/online/hive.qcow2             2986177b-9597-4cbb-8a80-14deb15fc086  
  glance image-download --file /root/online/interfance.qcow2       4763a141-548e-4cca-9711-ba658c71efcf  
  glance image-download --file /root/online/kafka.qcow2            8f87cd3a-4026-4d8e-9742-62ad9ad945ec  
  glance image-download --file /root/online/minhang.qcow2          c195d8ca-d3f1-4c01-b9bb-b0cd089bdfb4  
  glance image-download --file /root/online/rizhi.qcow2            64a03024-4e5a-461c-8fee-606dfd5bf7ba  
  glance image-download --file /root/online/spark.qcow2            64f7c585-ee8e-4a58-834d-339b71950662  
  glance image-download --file /root/online/storm.qcow2            518918a4-36dd-4b7b-a117-84fed1bfed79  
  glance image-download --file /root/online/teseinterface.qcow2    2b3df338-fc3a-4a44-ac8d-3fbbf014cd6d  
  glance image-download --file /root/online/test1.qcow2            5bb7cae4-b5bd-4c0e-b6d4-969627cbe572  
  glance image-download --file /root/online/testkuizao.qcow2       675f16c2-4f5d-4cfa-bbc8-94173c0697f6  
  glance image-download --file /root/online/tianqi.qcow2           30b4a9f9-2cd8-4366-ac95-3560202e83fd  
  glance image-download --file /root/online/win2008.qcow2          e3da28d4-e72c-49c3-9fa8-3ebd8516c723  
  glance image-download --file /root/online/yiyao.qcow2            43aeaf93-b2b8-40bc-b512-f3e9dfd3a106  
  glance image-download --file /root/online/yuqing.qcow2           10e1ff6c-87d3-4b06-a281-e1d015654a7a  




#
ceph 命令
nova show c797bc22-4176-480a-82fb-a07889987c65  #虚拟机ID
rbd ls vms | grep c797bc22-4176-480a-82fb-a07889987c65 #查看虚拟机硬盘

rbd ls volumes #查看卷

#导出虚拟机硬盘
rbd export -p vms c797bc22-4176-480a-82fb-a07889987c65_disk  github.raw

#raw转为qcow2格式
qemu-img convert -f raw -O qcow2 github.raw github.qcow2

#qcow2转换为vmdk文件
qemu-img convert -f qcow2 github.qcow2 -O vmdk github.vmdk

 

posted @ 2021-03-16 11:43  小⑦  阅读(186)  评论(0)    收藏  举报