searchusermenu
  • 发布文章
  • 消息中心
点赞
收藏
评论
分享

nova基本命令 libvirt相关

2023-10-31 02:20:16
16
0
类别 Nova V2 REST API Action Nova CLI Horizon 解释
虚机操作 POST boot Launch Instance

启动一个新的虚机

  DELETE delete Terminate Instance

关闭和删除一个虚机

  1. call dom.destroy
  2. call dom.undefineFlags
  confirmResize  resize-confirm  N/A

确认 resize 操作 

  revertResize  resize-revert N/A 

取消 resize 操作

  reboot  reboot [--hard]

Soft Reboot Instance

Hard Reboot Instance 

重启虚机

  changePassword  root-password    libvirt driver 没有实现
  resize  resize  Resize Instance 迁移虚机或者改变虚机的flavor
  rebuild  rebuild  Rebuild Instance  先调用 driver.destroy (destroy domain,detach volume connections,plug VIF), 然后再调用 driver.spawn
  createImage  image-create  N/A   快照
  os-start  start  Launch Instance  = hard reboot
  os-stop  stop  Shut Off Instance  call dom.destroy
admin action pause  pause  Pause Instance  call dom.suspend
  unpause  unpause  Resume Instance  call dom.resume
  suspend  suspend  N/A
  1.  _detach_pci_devices
  2. _detach_sriov_ports
  3. dom.managedSave(0)
  resume  resume N/A 
  1.  get domain xml
  2. _create_domain_and_network
  3. attach pci devices
  4. attach sriov port
  migrate  migrate  N/A 迁移
  resetNetwork   N/A   libvirt 没有实现
  injectNetworkInfo   N/A   Set up basic filtering (MAC, IP, and ARP spoofing protection),调用 _conn.nwfilterDefineXML(xml)
  lock  lock  N/A  直接在数据库中 instance 上面设置 lock = true
  unlock  unlock  N/A  直接在数据库中 instance 上面设置 lock = false
  createBackup  backup N/A 

 同 createImage,可以指定类型(daily 或者 weekly),和保存的 image 的最大数目,老的 image 会被删除

{"backup_type": "daily", "rotation": "2", "name": "bk"}

  os-migrateLive  live-migration N/A   热迁移
  os-resetState  reset-state  N/A  传入 state 参数,直接修改数据库中 instance 的状态
bare metal add_interface  baremetal-interface-add   TBD
  remove_interface  baremetal-interface-remove   TBD 
cloudpipe update  cloudpipe-configure   TBD
console os-getVNCConsole  get-vnc-console  Console

 

  os-getSPICEConsole  get-spice-console   TBD
  os-getRDPConsole  get-rdp-console   TBD 
  os-getSerialConsole     TBD 
  os-getConsoleOutput console-log  View Log  读取 虚机的 console.log 文件并返回其内容;如果没有这文件的话,则使用 “pty”,将其内容写入到 consolue文件并返回其内容。
delete restore  restore  Terminate Instance  Restore a previously deleted (but not reclaimed) instance。直接修改数据库。
  forceDelete  force-delete  N/A

 有 snapshot,则全部删除;然后从 DB 中删除 instance.

evacuate evacuate  evacuate    从 DB 中读取 instance 数据,在一个新的主机上 rebuild。
flavor access addTenantAccess  flavor-access-add  Flavor - Modify Access  修改 DB 中 flavor 表
  removeTenantAccess  flavor-access-remove  Flavor - Modify Access  修改 DB 中 flavor 表
flavor manage delete  flavor-delete  Flavor - Delete Flavor 直接 DB 操作
  create  flavor-create  Flavor - Create Flavor  直接 DB 操作
floating ip addFloatingIp  floating-ip-create  Associate Floating IP  调用 network_api.associate_floating_ip
  removeFloatingIp  floating-ip-delete  Disassociate Floating IP  调用 network_api.disassociate_floating_ip
NIC addFixedIp  fixed-ip-reserve  

 参数 "networkId"。

  1. call network_api.add_fixed_ip_to_instance
  2. call firewall_driver.setup_basic_filtering
  removeFixedIp  fixed-ip-unreserve  

 参数 "address"。

  1. call network_api.remove_fixed_ip_from_instance
  2. call firewall_driver.setup_basic_filtering(instance, nw_info) 
network associate disassociate_host      Associate or disassociate host or project to network。 call network_api.associate
  disassociate_project  network-disassociate    call network_api.associate
  associate_host  network-associate-host    call network_api.associate
os network disassociate      call network_api.associate
rescue rescue  rescue    
  unrescue  unrescue    
security group addSecurityGroup  add-secgroup    call security_group_rpcapi.refresh_security_group_rules
  removeSecurityGroup  secgroup-delete    call security_group_rpcapi.refresh_security_group_rules
shelve shelve  shelve    
  shelveOffload  shelve-offload    
  unshelve  unshelve    
0条评论
0 / 1000
y****n
4文章数
0粉丝数
y****n
4 文章 | 0 粉丝

nova基本命令 libvirt相关

2023-10-31 02:20:16
16
0
类别 Nova V2 REST API Action Nova CLI Horizon 解释
虚机操作 POST boot Launch Instance

启动一个新的虚机

  DELETE delete Terminate Instance

关闭和删除一个虚机

  1. call dom.destroy
  2. call dom.undefineFlags
  confirmResize  resize-confirm  N/A

确认 resize 操作 

  revertResize  resize-revert N/A 

取消 resize 操作

  reboot  reboot [--hard]

Soft Reboot Instance

Hard Reboot Instance 

重启虚机

  changePassword  root-password    libvirt driver 没有实现
  resize  resize  Resize Instance 迁移虚机或者改变虚机的flavor
  rebuild  rebuild  Rebuild Instance  先调用 driver.destroy (destroy domain,detach volume connections,plug VIF), 然后再调用 driver.spawn
  createImage  image-create  N/A   快照
  os-start  start  Launch Instance  = hard reboot
  os-stop  stop  Shut Off Instance  call dom.destroy
admin action pause  pause  Pause Instance  call dom.suspend
  unpause  unpause  Resume Instance  call dom.resume
  suspend  suspend  N/A
  1.  _detach_pci_devices
  2. _detach_sriov_ports
  3. dom.managedSave(0)
  resume  resume N/A 
  1.  get domain xml
  2. _create_domain_and_network
  3. attach pci devices
  4. attach sriov port
  migrate  migrate  N/A 迁移
  resetNetwork   N/A   libvirt 没有实现
  injectNetworkInfo   N/A   Set up basic filtering (MAC, IP, and ARP spoofing protection),调用 _conn.nwfilterDefineXML(xml)
  lock  lock  N/A  直接在数据库中 instance 上面设置 lock = true
  unlock  unlock  N/A  直接在数据库中 instance 上面设置 lock = false
  createBackup  backup N/A 

 同 createImage,可以指定类型(daily 或者 weekly),和保存的 image 的最大数目,老的 image 会被删除

{"backup_type": "daily", "rotation": "2", "name": "bk"}

  os-migrateLive  live-migration N/A   热迁移
  os-resetState  reset-state  N/A  传入 state 参数,直接修改数据库中 instance 的状态
bare metal add_interface  baremetal-interface-add   TBD
  remove_interface  baremetal-interface-remove   TBD 
cloudpipe update  cloudpipe-configure   TBD
console os-getVNCConsole  get-vnc-console  Console

 

  os-getSPICEConsole  get-spice-console   TBD
  os-getRDPConsole  get-rdp-console   TBD 
  os-getSerialConsole     TBD 
  os-getConsoleOutput console-log  View Log  读取 虚机的 console.log 文件并返回其内容;如果没有这文件的话,则使用 “pty”,将其内容写入到 consolue文件并返回其内容。
delete restore  restore  Terminate Instance  Restore a previously deleted (but not reclaimed) instance。直接修改数据库。
  forceDelete  force-delete  N/A

 有 snapshot,则全部删除;然后从 DB 中删除 instance.

evacuate evacuate  evacuate    从 DB 中读取 instance 数据,在一个新的主机上 rebuild。
flavor access addTenantAccess  flavor-access-add  Flavor - Modify Access  修改 DB 中 flavor 表
  removeTenantAccess  flavor-access-remove  Flavor - Modify Access  修改 DB 中 flavor 表
flavor manage delete  flavor-delete  Flavor - Delete Flavor 直接 DB 操作
  create  flavor-create  Flavor - Create Flavor  直接 DB 操作
floating ip addFloatingIp  floating-ip-create  Associate Floating IP  调用 network_api.associate_floating_ip
  removeFloatingIp  floating-ip-delete  Disassociate Floating IP  调用 network_api.disassociate_floating_ip
NIC addFixedIp  fixed-ip-reserve  

 参数 "networkId"。

  1. call network_api.add_fixed_ip_to_instance
  2. call firewall_driver.setup_basic_filtering
  removeFixedIp  fixed-ip-unreserve  

 参数 "address"。

  1. call network_api.remove_fixed_ip_from_instance
  2. call firewall_driver.setup_basic_filtering(instance, nw_info) 
network associate disassociate_host      Associate or disassociate host or project to network。 call network_api.associate
  disassociate_project  network-disassociate    call network_api.associate
  associate_host  network-associate-host    call network_api.associate
os network disassociate      call network_api.associate
rescue rescue  rescue    
  unrescue  unrescue    
security group addSecurityGroup  add-secgroup    call security_group_rpcapi.refresh_security_group_rules
  removeSecurityGroup  secgroup-delete    call security_group_rpcapi.refresh_security_group_rules
shelve shelve  shelve    
  shelveOffload  shelve-offload    
  unshelve  unshelve    
文章来自个人专栏
openstack_yxc
4 文章 | 1 订阅
0条评论
0 / 1000
请输入你的评论
0
0