summaryrefslogtreecommitdiffstats
path: root/deploy/environment.py
diff options
context:
space:
mode:
authorAlex Yang <yangyang1@zte.com.cn>2017-07-29 20:29:52 +0800
committerAlex Yang <yangyang1@zte.com.cn>2017-07-31 15:35:11 +0800
commitb35baf61e48a1d2aff88e7c3e100aa996422d849 (patch)
treeded0fe80802a336d1729f607baadac9a90e3b5e5 /deploy/environment.py
parente47fc2d62d07633c1883253d42f8e2cade35e868 (diff)
Correct the mapping of nodes and roles in virtual deploy
JIRA: DAISY-56 Now the roles are assigned to nodes randomly, because the function 'add_hosts_interface' in tempest.py just uses zip to map the host's name to the host. libvirt_utils.py: get mac addresses from VM environment.py: save the mac addresses daisy_server.py: write a new deploy.yml which contains the mac addresses and copy the file to daisy server get_conf.py: get mac addresses from the new deploy.yml tempest.py: assigned roles to nodes when the mac addresses matched controller.xml: increase the RAM to make difference with computer nodes deploy.sh: apply this change to bash script Change-Id: Ia61b60d39d319c5d01e3505727fafc63a0585858 Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
Diffstat (limited to 'deploy/environment.py')
-rw-r--r--deploy/environment.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/deploy/environment.py b/deploy/environment.py
index abea6210..87c16937 100644
--- a/deploy/environment.py
+++ b/deploy/environment.py
@@ -26,7 +26,8 @@ from libvirt_utils import (
reboot_vm,
delete_vm_and_disk,
create_virtual_network,
- delete_virtual_network
+ delete_virtual_network,
+ get_vm_mac_addresses
)
from utils import (
WORKSPACE,
@@ -252,7 +253,7 @@ class VirtualEnvironment(DaisyEnvironmentBase):
create_virtual_disk(ceph_disk_file, ceph_size)
disks.append(ceph_disk_file)
- create_vm(template, name, disks)
+ return create_vm(template, name, disks)
def create_nodes(self):
# TODO: support virtNetTemplatePath in deploy.yml
@@ -263,7 +264,8 @@ class VirtualEnvironment(DaisyEnvironmentBase):
self._daisy_keepalived_net = net_name
for node in self.deploy_struct['hosts']:
- self.create_virtual_node(node)
+ domain = self.create_virtual_node(node)
+ node['mac_addresses'] = get_vm_mac_addresses(domain)
time.sleep(20)
def reboot_nodes(self, boot_devs=None):
@@ -298,6 +300,7 @@ class VirtualEnvironment(DaisyEnvironmentBase):
def deploy(self, deploy_file, net_file):
self.server.prepare_cluster(deploy_file, net_file)
self.create_nodes()
+ self.server.copy_new_deploy_config(self.deploy_struct)
self.server.prepare_host_and_pxe()
LI('Begin Daisy virtual-deploy os and openstack')
self.reboot_nodes()