OpenStack uses the Nova API to designate compute node to create instance

Source: Internet
Author: User

We can see in our blog that we can create a virtual machine to a specified compute node with command line orientation

http://blog.csdn.net/qq_21398167/article/details/46710175


Nova Boot--image Fedora--flavor 1 test1--availability-zone nova:node-1

So I want to see if I can create such a instance through the API.

By viewing the Open source API in the official website, you can see

http://blog.csdn.net/qq_21398167/article/details/46530305

There is an API in this:

Create ( name, image, flavor, meta=none, files=none, reservation _id=none, min_count=none, max_count=none, security_groups=none, userdata= None, key_name=none, availability_zone=none, block_device_mapping=none, block_device_mapping_v2=none, nics=none, scheduler_hints=none, config_drive= None, disk_config=none, **kwargs )

Create (boot) a new server.

Parameters:
  • name –something to name the server.
  • image , haven image to boot with.
  • Flavor , haven flavor to boot onto.
  • Meta –a dict of arbitrary key/value metadata to store for Thisserver. Both keys and values must be <=255 characters.
  • files –a dict of files to Overrwrite on the server upon boot. Keys are file names (i.e./etc/passwd) and valuesare the file contents (either as a string or as Afile-like object ). A maximum of five entries is allowed,and each file must being 10k or less.
  • reservation_id –a UUID for the set of servers being requested.
  • Min_count – (optional extension) the minimum number ofservers to launch.
  • Max_count – (optional extension) The maximum number ofservers to launch.
  • security_groups –a List of security group names
  • UserData –user data to pass to is exposed by the Metadataserver this can is a file type object as well or Astrin G.
  • key_name – (optional extension) name of previously Createdkeypair to inject into the instance.
  • Availability_zone –name of the availability zone for instanceplacement.
  • block_device_mapping – (optional extension) A dict of blockdevice mappings for the this server.
  • block_device_mapping_v2 – (optional extension) A dict of blockdevice mappings for the this server.
  • NICs – (optional extension) an ordered list of NICs to beadded to this server, with information aboutconnected NE Tworks, fixed IPs, port etc.
  • scheduler_hints – (optional extension) arbitrary key-value pairsspecified by the client to help boot an instance
  • config_drive – (optional extension) value for config Driveeither boolean, or Volume-id
  • disk_config – (optional extension) control how the disk ispartitioned when the server is created. PossibleValues is ' AUTO ' or ' MANUAL '.
This API has the same parameters--availability-zone


So just use this API to replace the default parameter None with the one you want to direct the compute node name is OK!

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

OpenStack uses the Nova API to designate compute node to create instance

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.