From 79b28cafced7e3516dd75d6251d0bd4bc60693e0 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Mon, 15 Apr 2013 21:47:45 -0400 Subject: [PATCH] specify instance host using availability_zone arg instead of scheduler_hints --- plstackapi/openstack/driver.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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): -- 2.47.0