[KUBEV] Extend template to support hybrid lab deployments.

Add VM Compute resource to deploy virtual nodes using virtual BMC
and connect the phys network (pxe) to instances.

Related: KUBEV-414
Change-Id: I7b5409ae1b4336f3ab78ecb63b435a6036200bd9
diff --git a/hco/top.yaml b/hco/top.yaml
index 272d90f..7e5f4af 100644
--- a/hco/top.yaml
+++ b/hco/top.yaml
@@ -67,6 +67,26 @@
     type: number
     description: Boot timeout for instance
     default: 600
+  # Hybrid lab parameters
+  hybrid_lab:
+    type: boolean
+    description: Deploy VM Compute for hybrid deployment (BM + virtual nodes).
+    default: false
+  vm_compute_flavor:
+    type: string
+    default: 'system.golden.openstack.control'
+  pxe_network:
+    type: string
+    description: The name of pxe network
+    default: ''
+  pxe_subnet:
+    type: string
+    default: ''
+
+conditions:
+
+  deploy_vm_compute:
+    get_param: hybrid_lab
 
 resources:
 
@@ -194,6 +214,26 @@
           metadata: { get_param: worker_metadata }
           hardware_metadata: { get_param: hardware_metadata}
           boot_timeout: { get_param: boot_timeout }
+          hybrid_lab: { get_param: hybrid_lab }
+          pxe_network: { get_param: pxe_network }
+          pxe_subnet: { get_param: pxe_subnet }
+
+  vm_compute:
+    type: ./fragments/VMCompute.yaml
+    condition: deploy_vm_compute
+    depends_on:
+      - k8s_network
+      - data_network
+      - public_router_iface
+    properties:
+      k8s_network: { get_resource: k8s_network }
+      k8s_subnet_id: { get_resource: k8s_subnet }
+      public_net_id: { get_param: public_net_id }
+      pxe_network: { get_param: pxe_network }
+      pxe_subnet: { get_param: pxe_subnet }
+      image: { get_param: image }
+      flavor: { get_param: vm_compute_flavor }
+      key_name: { get_attr: [ keypair_name, value ] }
 
 outputs:
   masters_ips:
@@ -214,3 +254,15 @@
   public_router_gw_ipv6:
     description: Public gateway IPv6 address (used for kubevirt tests)
     value: { get_param: k8s_network_ipv6_gw_ip }
+  vm_compute_ip:
+    condition: deploy_vm_compute
+    description: Public IP address of the deployed compute instance
+    value: { get_attr: [ vm_compute, server_public_ip ] }
+  vbmc_ip:
+    condition: deploy_vm_compute
+    description: IP address of interface in PXE network (is used for virtual BMC)
+    value: { get_attr: [ vm_compute, vbmc_ip ] }
+  vnodes_data:
+    condition: deploy_vm_compute
+    description: Virtual nodes data (mac addresses and vbmc ports)
+    value: { get_attr: [ vm_compute, vnodes_data ] }