Failed in using --availability-zone zone:hostname to specify a certain host when booting vms

Asked by Min Li

Hi,

I'm using Ubuntu12.04 and Folsom with nova-network. Currently I have a controller node, which do not have nova-compute service and two compute node (os-com1 and os-com2).
Everything is fine and I can boot vms and ssh. But when I tried to boot a vm on a specified host using the option --availability-zone zone-1:os-com1, it just didn't work as expected. The spawned vm is still randomly booting on os-com1 and os-com2 (or following the less workload first order).
I specified the node_availability_zone=zone-1 in the nova.conf file of all the controller and compute nodes. And nova-manage service list shows as expected.
And I'm using the admin role when booting vm.

So, do I need to use certain scheduler or filter to make this option work? I've tried AvailabilityZoneFilter, but it did not make any difference.

Thank you!
Min

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Solved by:
Min Li
Solved:
Last query:
Last reply:
Revision history for this message
Tiantian Gao (gtt116) said :
#1

Hi,

Can you put your nova.conf and result of "nova-manage service" here. Maybe we can find some issues.

Revision history for this message
Min Li (limin-marcus) said :
#2

Thank you, Tiantian.

The nova.conf is as follows:

[DEFAULT]
logdir=/var/log/nova
state_path=/var/lib/nova
lock_path=/run/lock/nova
verbose=True
api_paste_config=/etc/nova/api-paste.ini
scheduler_driver=nova.scheduler.simple.SimpleScheduler
scheduler_default_filters=AvailabilityZoneFilter
s3_host=192.168.3.11
ec2_host=192.168.3.11
ec2_dmz_host=192.168.3.11
rabbit_host=192.168.3.11
metadata_host=127.0.0.1
metadata_listen=0.0.0.0
nova_url=http://192.168.3.11:8774/v1.1/
sql_connection=mysql://novaUser:novaPass@192.168.3.11/nova
ec2_url=http://192.168.3.11:8773/services/Cloud
root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf

# Availability zone
node_availability_zone=zone-1

# Auth
use_deprecated_auth=false
auth_strategy=keystone
keystone_ec2_url=http://192.168.3.11:5000/v2.0/ec2tokens
# Imaging service
glance_api_servers=192.168.3.11:9292
image_service=nova.image.glance.GlanceImageService

# Vnc configuration
novnc_enabled=true
novncproxy_base_url=http://192.168.3.11:6080/vnc_auto.html
novncproxy_port=6080
vncserver_proxyclient_address=192.168.3.11
vncserver_listen=0.0.0.0

# nova-network
libvirt_use_virtio_for_bridges = True
network_manager=nova.network.manager.FlatDHCPManager
dhcpbridge_flagfile=/etc/nova/nova.conf
dhcpbridge=/usr/bin/nova-dhcpbridge
public_interface=br100
flat_interface=eth0
flat_network_bridge=br100
fixed_range=192.168.100.0/24
flat_network_dhcp_start=192.168.100.2
network_size=256
force_dhcp_release = True
flat_injected=false
use_ipv6=false
multi_host=True

# Compute #
compute_driver=libvirt.LibvirtDriver
# Cinder #
volume_api_class=nova.volume.cinder.API
osapi_volume_listen_port=5900

And the results for nova-manage service list is:

Binary Host Zone Status State Updated_At
nova-cert os-ctrl zone-1 enabled :-) 2013-01-31 14:34:52
nova-consoleauth os-ctrl zone-1 enabled :-) 2013-01-31 14:34:52
nova-console os-ctrl zone-1 enabled :-) 2013-01-31 14:34:52
nova-scheduler os-ctrl zone-1 enabled :-) 2013-01-31 14:34:56
nova-network os-ctrl zone-1 enabled :-) 2013-01-31 14:34:56
nova-compute os-com1 zone-1 enabled :-) 2013-01-31 14:34:53
nova-network os-com1 zone-1 enabled :-) 2013-01-31 14:34:56
nova-compute os-com2 zone-1 enabled :-) 2013-01-31 14:34:57
nova-network os-com2 zone-1 enabled :-) 2013-01-31 14:34:56

I used the following command to boot a vm:
nova boot --image $IMAGE_ID --flavor $FLAVOR --availability-zone zone-1:os-com1 vm1

And no error or anything pop up, but the vm is shown to be on os-com2 when using the command "nova show vm1".

I tried without configuring the filter in nova.conf, but the result is the same. I am thinking about add some scheduler option in nova.conf. Not sure if this can make some difference.

Revision history for this message
Min Li (limin-marcus) said :
#3

Hi,

I was told by some other people that:
"
The Simple Scheduler doesn't support that. You should use a scheduler that supports Availability Zone like Filter Scheduler. Some more settings should be like:

# Nova Scheduler
scheduler_driver=nova.scheduler.multi.MultiScheduler
volume_scheduler_driver=nova.scheduler.chance.ChanceScheduler
compute_scheduler_driver=nova.scheduler.filter_scheduler.FilterScheduler
scheduler_available_filters=nova.scheduler.filters.standard_filters
scheduler_default_filters=AvailabilityZoneFilter,RamFilter,ComputeFilter
least_cost_functions=nova.scheduler.least_cost.compute_fill_first_cost_fn
compute_fill_first_cost_fn_weight=-1.0
"
I'm testing these options.
Does someone know the minimal requirement for scheduler and filter to make this --availabilty-zone work?

Revision history for this message
Tiantian Gao (gtt116) said :
#4

Hi Min,

I think you can try to remove two entry in nova.conf, and restart the nova services. Then make another try.

scheduler_driver=nova.scheduler.simple.SimpleScheduler
scheduler_default_filters=AvailabilityZoneFilter

Good luck.

Revision history for this message
Min Li (limin-marcus) said :
#5

Hi Tiantian,

It really works!
Guess the default ones are working well in understanding this availability-zone option.

Thank you very much!