pip freeze | grep python-
nova secgroup-add-rule SEC_GROUP_NAME tcp 22 22 0.0.0.0/0
nova secgroup-add-group-rule --ip_proto tcp --from_port 22 \ --to_port 22 SEC_GROUP_NAME SOURCE_GROUP_NAME
nova secgroup-add-rule SEC_GROUP_NAME icmp -1 -1 0.0.0.0/0
nova secgroup-add-group-rule --ip_proto icmp --from_port -1 \ --to_port -1 SEC_GROUP_NAME SOURCE_GROUP_NAME
nova secgroup-add-rule SEC_GROUP_NAME udp 53 53 0.0.0.0/0
nova secgroup-add-group-rule --ip_proto udp --from_port 53 \ --to_port 53 SEC_GROUP_NAME SOURCE_GROUP_NAME
nova secgroup-delete-rule SEC_GROUP_NAME tcp 22 22 0.0.0.0/0
nova secgroup-delete-group-rule --ip_proto tcp --from_port 22 \ --to_port 22 SEC_GROUP_NAME SOURCE_GROUP_NAME
nova boot --flavor FLAVOR_ID --image IMAGE_ID --key_name KEY_NAME --user-data mydata.file \ --security_group SEC_GROUP NAME_FOR_INSTANCE --meta KEY=VALUE --meta KEY=VALUE
cinder create --image-id 397e713c-b95b-4186-ad46-6126863ea0a9 --display-name my-bootable-vol 8
nova boot --flavor <flavor> --block_device_mapping <dev_name>=<id>:<type>:<size>:<delete_on_terminate> <name>
exp:
-
--block_device_mapping dev- name=id:type:size:delete-on-terminate
-
dev-name. A device name where the volume is attached in the system at /dev/dev_name. This value is typically vda.
-
id. The ID of the volume to boot from, as shown in the output of nova volume-list.
-
type. Either snap or any other value, including a blank string. Snap means that the volume was created from a snapshot.
-
size. The size of the volume, in GBs. It is safe to leave this blank and have the Compute service infer the size.
-
delete-on-terminate. A boolean that indicates whether the volume should be deleted when the instance is terminated. You can specify
-
True or 1
-
False or 0
egg:
nova boot --flavor 2 --image 397e713c-b95b-4186-ad46-6126863ea0a9 --block_device_mapping vda=bd7cf584-45de-44e3-bf7f-f7b50bf235e3:::0 myInstanceFromVolume
nova floating-ip-pool-list
floating-ip-create POOL_NAME
nova floating-ip-list
...
nova floating-ip-disassociate INSTANCE_NAME_OR_ID FLOATING_IP
nova resize-confirm 6beefcf7-9de6-48b3-9ba9-e11b343189b3
nova resize-revert 6beefcf7-9de6-48b3-9ba9-e11b343189b3
nova pause SERVER
nova un-pause SERVER
nova suspend SERVER
nova resume SERVER
nova reboot SERVER
nova reboot --hard SERVER
nova host-list
nova evacuate evacuated_server_name host_b
nova evacuate evacuated_server_name host_b --on-shared-storage
nova delete newServer
nova get-vnc-console myCirrosServer xvpvnc
裸机:
-
baremetal-interface-add
-
baremetal-interface-list
-
baremetal-interface-remove
-
baremetal-node-create
-
baremetal-node-delete
-
baremetal-node-list
-
baremetal-node-show
heat stack-update mystack --template-file=/path/to/heat/templates/WordPress_Single_Instance_v2.template --parameters="InstanceType=m1.large;DBUsername=wp;DBPassword=verybadpassword;KeyName=heat_key;LinuxDistribution=F17"
keystone:
keystone user-create --name=alice --pass=mypassword123 --email=alice@example.com
keystone tenant-create --name=acme
keystone role-create --name=compute-user
keystone user-list
keystone user-role-add --user=892585 --role=9a764e --tenant-id=6b8fd2