- OpenStack Cloud Computing Cookbook(Fourth Edition)
- Kevin Jackson Cody Bunch Egle Sigler James Denton
- 391字
- 2021-07-02 16:25:06
Common OpenStack server (instances) tasks
This section outlines a number of common commands that can be run when operating with instances (for example, virtual machines). For more detailed information and explanation of each task, refer to Chapter 5, Nova – OpenStack Compute.
Getting ready
Ensure that you have the OpenStack clients installed as described in the first recipes of this chapter.
How to do it…
Carry out the following to launch and manipulate running instances:
To launch in an instance from the command line, you need the following information:
- An image
- A network
- A flavor
- An optional security group (default is used otherwise)
- An optional key (if you intend to access the instance)
Carry out the following steps to launch an instance from the command line:
- First, list the images available:
openstack image list
- Now we list the networks available (it will be the UUID of the Network we will use):
openstack network list
- We need a flavor, if you need reminding of them, list them with the following command:
openstack flavor list
- If you require specific security groups, list them with the following command:
openstack security group list
- If you need to get the name of the key pair to use, use the following command:
openstack keypair list
- Now you can boot the instance with the following command:
openstack server create --image IMAGE --flavor FLAVOR --security-group SECGROUP --nic net-id=NETWORK_UUID --key-name KEYPAIR_NAME INSTANCE_NAME
To list the OpenStack instances launched, issue the following command:
openstack server list
To create a snapshot of a running instance, carry out the following command:
openstack server image create --name snapshotRunningWebserver1 myRunningWebserver1
To alter the flavor of a running instance and respawn with the new settings, carry out the following commands:
- We first specify the new flavor size with the following command:
openstack server resize --flavor m1.small myWebserver1
- Next, list the running instances to confirm the state. The status should be
VERIFY_RESIZE
:openstack server list
This shows output like the following:
- Then we confirm the action with the following command:
openstack server resize --confirm myWebserver1
- 三維圖形化C++趣味編程
- Practical DevOps
- C#程序設計教程
- Amazon S3 Cookbook
- Python機器學習基礎教程
- Mastering Linux Network Administration
- Mathematica Data Analysis
- Visual C#通用范例開發金典
- C#程序設計(項目教學版)
- HTML+CSS+JavaScript網頁設計從入門到精通 (清華社"視頻大講堂"大系·網絡開發視頻大講堂)
- 編寫高質量代碼:改善Objective-C程序的61個建議
- Simulation for Data Science with R
- Python Web自動化測試設計與實現
- Groovy 2 Cookbook
- IBM RUP參考與認證指南