diff options
-rw-r--r-- | apex/deploy.py | 13 | ||||
-rw-r--r-- | apex/undercloud/undercloud.py | 7 |
2 files changed, 15 insertions, 5 deletions
diff --git a/apex/deploy.py b/apex/deploy.py index 6a08b36f..6866945b 100644 --- a/apex/deploy.py +++ b/apex/deploy.py @@ -64,7 +64,8 @@ def validate_cross_settings(deploy_settings, net_settings, inventory): # "$tenant_nic_mapping_compute_members -def build_vms(inventory, network_settings): +def build_vms(inventory, network_settings, + template_dir='/usr/share/opnfv-apex'): """ Creates VMs and configures vbmc and host :param inventory: @@ -82,7 +83,8 @@ def build_vms(inventory, network_settings): name, volume_path, baremetal_interfaces=network_settings.enabled_network_list, memory=node['memory'], cpus=node['cpu'], - macs=[node['mac_address']]) + macs=[node['mac_address']], + template_dir=template_dir) virt_utils.host_setup({name: node['pm_port']}) @@ -123,22 +125,26 @@ def create_deploy_parser(): deploy_parser.add_argument('--virtual-computes', dest='virt_compute_nodes', default=1, + type=int, help='Number of Virtual Compute nodes to create' ' and use during deployment (defaults to 1' ' for noha and 2 for ha)') deploy_parser.add_argument('--virtual-cpus', dest='virt_cpus', default=4, + type=int, help='Number of CPUs to use per Overcloud VM in' ' a virtual deployment (defaults to 4)') deploy_parser.add_argument('--virtual-default-ram', dest='virt_default_ram', default=8, + type=int, help='Amount of default RAM to use per ' 'Overcloud VM in GB (defaults to 8).') deploy_parser.add_argument('--virtual-compute-ram', dest='virt_compute_ram', default=None, + type=int, help='Amount of RAM to use per Overcloud ' 'Compute VM in GB (defaults to 8). ' 'Overrides --virtual-default-ram arg for ' @@ -284,7 +290,7 @@ def main(): uc_external = True if args.virtual: # create all overcloud VMs - build_vms(inventory, net_settings) + build_vms(inventory, net_settings, args.deploy_dir) else: # Attach interfaces to jumphost for baremetal deployment jump_networks = ['admin'] @@ -311,6 +317,7 @@ def main(): else: root_pw = None undercloud = uc_lib.Undercloud(args.image_dir, + args.deploy_dir, root_pw=root_pw, external_network=uc_external) undercloud.start() diff --git a/apex/undercloud/undercloud.py b/apex/undercloud/undercloud.py index 7efc2cb3..a1af4d00 100644 --- a/apex/undercloud/undercloud.py +++ b/apex/undercloud/undercloud.py @@ -27,13 +27,15 @@ class Undercloud: """ This class represents an Apex Undercloud VM """ - def __init__(self, image_path, root_pw=None, external_network=False): + def __init__(self, image_path, template_path, + root_pw=None, external_network=False): self.ip = None self.root_pw = root_pw self.external_net = external_network self.volume = os.path.join(constants.LIBVIRT_VOLUME_PATH, 'undercloud.qcow2') self.image_path = image_path + self.template_path = template_path self.vm = None if Undercloud._get_vm(): logging.error("Undercloud VM already exists. Please clean " @@ -60,7 +62,8 @@ class Undercloud: direct_boot='overcloud-full', kernel_args=['console=ttyS0', 'root=/dev/sda'], - default_network=True) + default_network=True, + template_dir=self.template_path) self.setup_volumes() self.inject_auth() |