openstack common commands - nova

Keywords: snapshot OpenStack Database

      

1. View openstack version

nova-manage version

2. View nodes

nova host-list

3. View calculation nodes

nova hypervisor-list

4. View the virtual machines on the computing node

nova hypervisor-servers compute1

5. View the list of virtual machines

nova list

6. View the image list

nova image-list

7. View volume list

nova volume-list

8. View the list of key pairs

nova keypair-list

9. View the flavor list

nova flavor-list

10. View floating ip list

nova-manage floating list

nova floating-ip-list

11. View the list of security groups

nova secgroup-list

12. View the list of security group rules

nova secgroup-list-rules default

13. View floating ip

nova floating-ip-list

14. View virtual machine

nova show ID

15. Suspend / resume / start / shut down / delete virtual machine

nova suspend/resume/srart/stop/delete ID

16. (hard) restart virtual machine

nova reboot (--hard) ID

16a. Rescue mode

nova rescue VM_ID

16b. Restart the virtual machine and enter normal mode from rescue mode

nova unrescue VM_ID

16c. Use the specified image to enter rescue mode

nova rescue --rescue_image_ref IMAGE_ID VM_ID

17. Online migration

nova live-migration ID compute1

18. Create key

nova keypair-add oskey > oskey.priv

chmod 600 oskey.priv

19. Create / delete floating ip pool

nova floating-ip-bulk-create/delete 192.168.0.200/29

20. Create floating ip

nova floating-ip-create

21. Delete floating ip

nova floating-ip-delete xxx.xxx.xxx.xxx

22. Bind / unbind floating ip

nova floating-ip-associate ID xxx.xxx.xxx.xxx

23. Create a new virtual machine

nova boot --image image-ID --flavor m1.medium --key_name abc --availability_zone nova:compute1.cloud.internal  vmname

23a. Create a new virtual machine through block devices

cinder create --image-id IMAGE_ID --name VOLUME_NAME SIZE_IN_GB

nova boot --falvor FLAVOR_IDsource=volume,id=VOLUME_ID,dest=volume,shutdown=preserve,bootindex=0 VMNAME

24. Add / remove floating ip

nova add/remove-floating-ip ID xxx.xxx.xxx.xxx

25. Mount the cloud disk

nova volume-attach ID VOLNAME /dev/sdb

26. Uninstall the cloud disk

nova volume-detach ID VOLNAME

27. Create a snapshot

nova image-create ID "snapshot 1"

Adjust virtual machine resources

nova resize VM_NAME FLAVOR_ID --poll

Confirm adjusting virtual machine resources

nova resize-confirm VM_ID

Rollback if resource tuning fails

nova resize-revert VM_ID

Database synchronization

nova-manage db sync

View error log

nova-manage logs errors


Posted by xdracox on Sun, 08 Dec 2019 03:03:44 -0800