From: Tony Mack Date: Tue, 16 Apr 2013 01:47:45 +0000 (-0400) Subject: specify instance host using availability_zone arg instead of scheduler_hints X-Git-Tag: 1.0~103 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=79b28cafced7e3516dd75d6251d0bd4bc60693e0;p=plstackapi.git specify instance host using availability_zone arg instead of scheduler_hints --- diff --git a/plstackapi/openstack/driver.py b/plstackapi/openstack/driver.py index 67b5280..c56dcde 100644 --- a/plstackapi/openstack/driver.py +++ b/plstackapi/openstack/driver.py @@ -194,10 +194,9 @@ class OpenStackDriver: files = {'/root/.ssh/authorized_keys': authorized_keys} hints = {} + availability_zone = None if hostname: - #hints['force_hosts']= hostname - #hints['availability-zone'] = 'nova:%s' % hostname - pass + availability_zone = 'nova:%s' % hostname server = self.shell.nova.servers.create( name=name, key_name = key_name, @@ -205,7 +204,8 @@ class OpenStackDriver: image=image_id, security_group = security_group, files=files, - scheduler_hints=hints) + scheduler_hints=hints, + availability_zone=availability_zone) return server def destroy_instance(self, id):