Openstak 中, 常用 nova 命令对实例进行管理
常见管理方法有, 创建, 删除, 更改(resize flavor, 冷/热迁移), 查询 等
列出当前 tenant 中的实例
首先需要载入 keystone 验证信息
[root@gz-controller-209131 ~(keystone_admin)]# cat keystonerc_admin
export OS_USERNAME=admin
export OS_TENANT_NAME=admin
export OS_PASSWORD=你的openstack密码
export OS_AUTH_URL=http://240.70.115.80:5000/v2.0/ <- keystone 连接方法
export PS1='[\u@\h \W(keystone_admin)]\$ '
使用 source 命令导入验证信息
[root@gz-controller-209131 ~(keystone_admin)]# source keystonerc_admin
命令帮助
[root@hh-yun-puppet-129021 ~(keystone_admin)]# nova help | grep -E 'boot|list|delete|stop|remove'
absolute-limits Print a list of absolute limits for a user
agent-delete Delete existing agent build.
agent-list List all builds.
aggregate-delete Delete the aggregate.
aggregate-list Print a list of all aggregates.
aggregate-remove-host
availability-zone-list
boot Boot a new server.
cloudpipe-list Print a list of all cloudpipe instances.
delete Immediately shut down and delete specified server(s).
dns-delete Delete the specified DNS entry.
dns-delete-domain Delete the specified DNS domain.
dns-domains Print a list of available dns domains.
dns-list List current DNS entries for domain and ip or domain
flavor-access-list Print access information about the given flavor.
flavor-access-remove
flavor-delete Delete a specific flavor
flavor-list Print a list of available 'flavors' (sizes of
floating-ip-bulk-delete
Bulk delete floating ips by range.
floating-ip-bulk-list
floating-ip-delete De-allocate a floating IP.
floating-ip-list List floating ips for this tenant.
floating-ip-pool-list
host-list List all hosts by service.
hypervisor-list List hypervisors.
image-delete Delete specified image(s).
image-list Print a list of available images to boot from.
interface-list List interfaces attached to a server.
keypair-delete Delete keypair given by its name.
keypair-list Print a list of keypairs for a user
list List active servers.
list-secgroup List Security Group(s) of a server.
network-list Print a list of available networks.
quota-delete Delete quota for a tenant/user so their quota will
rate-limits Print a list of rate limits for a user
reboot Reboot a server.
rebuild Shutdown, re-image, and re-boot a server.
remove-fixed-ip Remove an IP address from a server.
remove-floating-ip DEPRECATED, use floating-ip-disassociate instead.
remove-secgroup Remove a Security Group from a server.
secgroup-delete Delete a security group.
secgroup-delete-group-rule
secgroup-delete-rule
secgroup-list List security groups for the current tenant.
secgroup-list-rules
server-group-delete
server-group-list Print a list of all server groups.
service-list Show a list of all running services. Filter by host &
stop Stop a server.
usage-list List usage data for all tenants.
volume-delete Remove volume(s).
volume-list List all the volumes.
volume-snapshot-delete
volume-snapshot-list
volume-type-delete Delete a specific flavor
volume-type-list Print a list of available 'volume types'.
instance-action-list
force-delete Force delete a server.
restore Restore a soft-deleted server.
net-delete Delete a network
net-list List networks
baremetal-interface-list
baremetal-interface-remove
baremetal-node-delete
baremetal-node-list
Print list of available baremetal nodes.
migration-list Print a list of migrations.
list-extensions List all the os-api extensions that are available.
创建主机相关帮助
[root@station140 ~(keystone_admin)]# nova boot
usage: nova boot [--flavor <flavor>] [--image <image>]
[--image-with <key=value>] [--boot-volume <volume_id>]
[--snapshot <snapshot_id>] [--num-instances <number>]
[--meta <key=value>] [--file <dst-path=src-path>]
[--key-name <key-name>] [--user-data <user-data>]
[--availability-zone <availability-zone>]
[--security-groups <security-groups>]
[--block-device-mapping <dev-name=mapping>]
[--block-device key1=value1[,key2=value2...]]
[--swap <swap_size>]
[--ephemeral size=<size>[,format=<format>]]
[--hint <key=value>]
[--nic <net-id=net-uuid,v4-fixed-ip=ip-addr,port-id=port-uuid>]
[--config-drive <value>] [--poll]
<name>
列出flavor-list
[root@hh-yun-puppet-129021 ~(keystone_admin)]# nova flavor-list
+--------------------------------------+-----------------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | S