Ask Your Question
0

Select host when creating VM

asked 2020-04-16 22:31:33 -0500

New_bee gravatar image

I'm using IBM PowerVC which is based on OpenStack. I'm able to create VM using curl. But I wanted to know the option to select Host where my VM is going to be created. I tried many options but still no luck

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2020-04-17 15:07:35 -0500

qumulus gravatar image

If you are using python-openstackclient, you can specify the host via the availability-zone. e.g. openstack server create --flavor <flavor> --image <image> --network <network> --availability-zone nova:compute123 myserver

edit flag offensive delete link more

Comments

No I'm not using python openstakclient. Just using curl.

New_bee gravatar imageNew_bee ( 2020-04-19 02:28:40 -0500 )edit

I was not aware of this syntax. See https://docs.openstack.org/nova/lates... for more info and alternatives.

Note, however, that you must be admin to select a host this way (except if you tweak the policy).

Bernd Bausch gravatar imageBernd Bausch ( 2020-04-19 09:23:28 -0500 )edit

You can also use the direct API (what you call "curl") to submit such a request. Set availability_zone or hypervisor_hostname; see https://docs.openstack.org/api-ref/co....

Bernd Bausch gravatar imageBernd Bausch ( 2020-04-19 09:26:04 -0500 )edit

availability_zone is like host_group. But I want to select particular Host inside availability_zone

New_bee gravatar imageNew_bee ( 2020-04-30 09:46:40 -0500 )edit
0

answered 2020-04-17 02:23:11 -0500

There are several options.

Images can have properties that define host characteristics like CPU architecture or hypervisor type.

An administrator can group hosts into host aggregates, then use flavors to expose those host aggregates to users.

Availability zones are implemented as host aggregates, but there purpose is slightly different. The goal of availability zones is to allow a user to create reliable services by running instances on hosts that are unlikely to go down at the same time.

edit flag offensive delete link more

Comments

Thanks for your reply! I'm not concern about High Availability. My environment is different and they just need an option to select a host while creating a VM. curl -l -k -i -X POST https://${IP}:5000/powervc/openstack/compute/v2/${PROJECTID}/servers -H "X-Auth-Token:$INSERTTOKEN" -H "Content-Type:

New_bee gravatar imageNew_bee ( 2020-04-17 06:49:08 -0500 )edit

application/jsaon" -d '{"server":{ "flavorRef":"'"$FLAVORID"'", "name": "'"$NEWVNMNAME"'", "networkId": "'"$NETWORKID"'", "imageRef": "'"$IMAGEID"'", "networks":[{"uuid"; "'"$NETWORKID"'"}], "powervm:storage_connectivity_group:; "'"$STORAGE_CONNECTIVITY_GROUP"'"}}'

New_bee gravatar imageNew_bee ( 2020-04-17 06:53:38 -0500 )edit

I can select the Host using GUI of PowerVC. So my guess is there should be some option while creating VM via cli.

New_bee gravatar imageNew_bee ( 2020-04-17 06:55:18 -0500 )edit

Yes, one of the above options.

Bernd Bausch gravatar imageBernd Bausch ( 2020-04-17 07:23:18 -0500 )edit

I created host aggregate but when I try to add the host to the aggregate I get error - "The host cannot be added to more than one aggregate" Code -400

New_bee gravatar imageNew_bee ( 2020-04-19 02:27:25 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

Stats

Asked: 2020-04-16 22:31:33 -0500

Seen: 61 times

Last updated: Apr 17

Related questions