blob: fae8f34f0063564de52dc1b2148d822791e2db9a [file] [log] [blame]
Denis Egorenkodcc233d2019-03-06 18:09:24 +04001====================
2Deploy cfg01 locally
3====================
4
5Deploy cfg01 on Ubuntu with QEMU/KVM (libvirt)
6==============================================
7
8**Prerequisites**
9
10Script will check and install next required packages: qemu-utils libvirt-bin virtinst qemu-kvm.
11
12**Common info**
13
14Script gives you an ability to deploy cfg01 VM with provided cfg01 Qcwo2 disk
15image and config-drive iso file on your local laptop.
16
17Script is operating by next ENV variables:
18
19 * VM_NAME - the name of VM to be created in VirtualBox. Default: 'cfg01-mcp.local'.
20 * VM_SOURCE_DISK - the name of virtual disk to be used for virtual machine. Can be relative or absolute path.
21 * VM_CONFIG_DISK - same as VM_SOURCE_DISK, but for config-drive ISO file.
22 * VM_MGM_BRIDGE_NAME - Bridge name to use for deploy management network. Should have Internet access if not
23 offline case. Optional, default: 'br-mgm'
24 * VM_CTL_BRIDGE_NAME - Bridge name to use for control network. Optional, default: 'br-ctl'
25 * VM_MGM_BRIDGE_DISABLE - Do not use host bridge for deploy management network and create new nat-network.
26 Optional, default: false
27 * VM_CTL_BRIDGE_DISABLE - Do not use host bridge for control network and create host-only based new network.
28 Optional, default: false
29 * VM_MGM_NETWORK_NAME - Name for deploy management network. Optional, default: 'mgm_network'
30 * VM_CTL_NETWORK_NAME - Name for control network. Optional, default: 'ctl_network'
31 * VM_MGM_NETWORK_GATEWAY - NAT-Service network gateway for deploy management network.
32 Optional, default: '192.168.15.1'
33 * VM_MGM_NETWORK_MASK - Network mask for deploy management network. Optional, default: '255.255.255.0'
34 * VM_CTL_NETWORK_GATEWAY - Host-only based network gateway for control network.
35 Optional, default: '192.168.56.1'
36 * VM_CTL_NETWORK_MASK - Network mask for control network. Optional, default: '255.255.255.0'
37
38Script will check that disk and config-drive are present and then define needed networks and spawn virtual machine.
39Then check that VM is up and running.
40
41Once VM is up and running you can use ``virsh console`` to check what is going on during deploy.
42It is recommended to specify username and password during model generation for login via VM console if
43something goes wrong. Once you are logged in you can follow usual debug procedure for cfg01 node.
44
45
Denis Egorenkof7aaccf2019-02-26 13:47:25 +040046Deploy cfg01 on Mac OS with VirtualBox
47======================================
48
49**Prerequisites**
50
51Recommended VirtualBox version is 5.2.26, with Extenstion pack for the same version:
52
53 * Get VirtualBox package for your system: https://download.virtualbox.org/virtualbox/5.2.26/
54 * Extension pack: https://download.virtualbox.org/virtualbox/5.2.26/Oracle_VM_VirtualBox_Extension_Pack-5.2.26.vbox-extpack
55 * Python JSON module
56
57**Common info**
58
59Script gives you an ability to deploy cfg01 VM with provided cfg01 VDI disk
60image and config-drive iso file on your local laptop.
61
62Script takes as arguments two URLs: for cfg01 disk image and for config-drive ISO file.
63Both arguments are required in specified order. All other parameters are optional and can
64be overrided by exporting them via 'export' command or by creating in script's
65run directory env file 'env_overrides' with next possible arguments:
66
67 * VM_NAME - the name of VM to be created in VirtualBox. Default: 'cfg01-mcp.local'.
68 * VM_DISK - the name of virtual disk to be used for virtual machine. Can be
69 an absolute path as well. This variable will be used as target file name for
70 downloading virtual machine disk, please be sure that path exists.
71 Default: 'cfg01-disk.vdi'
72 * CONFIG_DRIVE_ISO - same as VM_DISK, but for config-drive ISO file.
73 Default: 'cfg01.deploy-local.local-config.iso'
74 * AUTO_USER_CONFIRM - do not ask user confirmation to override some resource if already exists.
75 Default: false
76 * UPDATE_ISO_INTERFACES - Update network settings in provided config-drive ISO file.
77 The target and main hosts, which is used to deploy cfg01 instance, are based under
78 OS Linux family and QEMU/KVM virtualization and virtio net-driver. Xenial system, which
79 used for cfg01, already contains a new SystemD predictable network interface names mechanism [0],
80 which automatically assigns ens[3-9] interface names for VMs. VirtualBox is using multi-functional
81 network card, which leads to renaming all network interfaces to enp0s* names.
82 [0] https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
83 Default: true
84
85 * DEPLOY_NET_NAME - NAT-Service network name, which is used as primary interface for cfg01. This network
86 doesn't provided direct access to VM, it is possible to add manually port forwarding rules if needed, but
87 for VM access use host-only network CONTROL_NET. Default: 'deploy_nat_network'
88 * DEPLOY_NETWORK - NAT-Service network with CIDR to use. Should be same as on model generation
89 step 'networking'. Default: '192.168.15.0/24'
90 * DEPLOY_GATEWAY - NAT-Service network gateway. Should be same as on model generation step 'networking'.
91 Default: '192.168.15.1'
92 * DEPLOY_IP_ADDRESS - Primary deploy IP address, which is also specified during model generation.
93 Default: '192.168.15.15'
94
95 * CONTROL_NET_NAME - Host-only based network name, which has static names 'vboxnetX', where 'X' is simple
96 count of existing networks for such type. Default: 'vboxnet0'
97 * CONTROL_GATEWAY - Host-only based network gateway. Default: '192.168.56.1'
98 * CONTROL_NETWORK - Host-only based network with CIDR to use. Should be same as on model generation
99 step 'networking'. Default: '192.168.56.0/24'
100 * CONTROL_IP_ADDRESS - Control IP address, which is also specified during model generation.
101 Default: '192.168.56.15'
102
103Script will go through next steps:
104
105 * Download disk image and config drive ISO;
106 * Define virtual machine with provided parameters;
107 * If needed config-drive ISO network data will be updated on a fly;
108 * Run virtual machine.
109
110Once VM is up and running you can use VirtualBox VM console to check what is going on during deploy.
Denis Egorenkodcc233d2019-03-06 18:09:24 +0400111It will drop all logs into console and it doesn't matter loged in user or not. It is recommended to specify
112username and password during model generation for login via VM console if something goes wrong.
Denis Egorenkof7aaccf2019-02-26 13:47:25 +0400113Once you are logged in you can follow usual debug procedure for cfg01 node.