blob: 3351bb1e1aebe0dd04f2e18efb9150975375a48e [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
Denis Egorenkobcf88892019-04-26 19:45:30 +040014Script ``define-vm.sh`` gives you an ability to deploy cfg01 VM with provided cfg01 Qcwo2 disk
Denis Egorenkodcc233d2019-03-06 18:09:24 +040015image 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.
Denis Egorenkoc2656402019-04-19 18:17:50 +040021 You can download and use the following image: http://images.mcp.mirantis.net/cfg01-day01-2019.2.0.qcow2
22 * VM_CONFIG_DISK - Config-drive ISO file, can be relative or absolute path.
Denis Egorenkodcc233d2019-03-06 18:09:24 +040023 * VM_MGM_BRIDGE_NAME - Bridge name to use for deploy management network. Should have Internet access if not
24 offline case. Optional, default: 'br-mgm'
25 * VM_CTL_BRIDGE_NAME - Bridge name to use for control network. Optional, default: 'br-ctl'
26 * VM_MGM_BRIDGE_DISABLE - Do not use host bridge for deploy management network and create new nat-network.
27 Optional, default: false
28 * VM_CTL_BRIDGE_DISABLE - Do not use host bridge for control network and create host-only based new network.
29 Optional, default: false
30 * VM_MGM_NETWORK_NAME - Name for deploy management network. Optional, default: 'mgm_network'
31 * VM_CTL_NETWORK_NAME - Name for control network. Optional, default: 'ctl_network'
Denis Egorenkodcc233d2019-03-06 18:09:24 +040032
33Script will check that disk and config-drive are present and then define needed networks and spawn virtual machine.
Denis Egorenkobcf88892019-04-26 19:45:30 +040034Start VM with ``virsh start <VM_NAME>``. Then check that VM is up and running.
Denis Egorenkodcc233d2019-03-06 18:09:24 +040035
36Once VM is up and running you can use ``virsh console`` to check what is going on during deploy.
Denis Egorenkobcf88892019-04-26 19:45:30 +040037It is recommended to specify username and password/ssh-key during model generation for login via VM console or ssh if
Denis Egorenkodcc233d2019-03-06 18:09:24 +040038something goes wrong. Once you are logged in you can follow usual debug procedure for cfg01 node.
39
Denis Egorenkobcf88892019-04-26 19:45:30 +040040When cfg01 is bootstrapped and configured, Jenkins is available via: http://<salt_master_management_address>:8081/
41Default login creds are: root/r00tme
42
Denis Egorenkoc2656402019-04-19 18:17:50 +040043Deploy OpenStack All-In-One node on Ubuntu with QEMU/KVM (libvirt)
44==================================================================
45
46**Prerequisites**
47
48Setup cfg01 node and it's up, running and configured.
49
50**Common info**
51
Denis Egorenkobcf88892019-04-26 19:45:30 +040052Script ``define-slave-vm.sh`` gives you an ability to deploy OpenStack All-in-one VM with provided Qcwo2 disk
Denis Egorenkoc2656402019-04-19 18:17:50 +040053image and config-drive iso file on your local laptop.
54
55Script is operating by next ENV variables:
56
57 * SLAVE_VM_NAME - the name of VM to be created in VirtualBox.
58 * SLAVE_VM_SOURCE_DISK - the name of virtual disk to be used for virtual machine. Can be relative or absolute path.
59 You can download and use the following image: http://images.mcp.mirantis.net/ubuntu-16-04-x64-mcp2019.2.0.qcow2
60 * SLAVE_VM_MEM_KB - amount of RAM for VM in KB. Default is: 16777216
61 * SLAVE_VM_CPUS - amount of CPUs to use. Default is: 4.
Denis Egorenko6cb60522019-07-17 21:36:52 +040062 * VM_PUBLIC_NET_NEEDED - create or not additional public interface for instance, which is used to provide
63 public addresses for OpenStack. Default is: false. But for slave AIO node can not be overrided and set to true.
64 * VM_PUBLIC_BRIDGE_NAME - Bridge name to use for public network. Optional, default: 'br-pub'
65 * VM_PUBLIC_BRIDGE_DISABLE - Do not use host bridge for public OpenStack network and create host-only based new network. Optional, default: false
66 * VM_PUBLIC_NETWORK_NAME - Name for public OpenStack network. Optional, default: 'pub_network'
Denis Egorenkoc2656402019-04-19 18:17:50 +040067
68Next parameters should be same as for cfg01 node:
69
70 * VM_CONFIG_DISK
71 * VM_MGM_BRIDGE_NAME
72 * VM_CTL_BRIDGE_NAME
73 * VM_MGM_BRIDGE_DISABLE
74 * VM_CTL_BRIDGE_DISABLE
75 * VM_MGM_NETWORK_NAME
76 * VM_CTL_NETWORK_NAME
Denis Egorenkoc2656402019-04-19 18:17:50 +040077
Denis Egorenko6cb60522019-07-17 21:36:52 +040078Next parameter:
79
80 * RECREATE_NETWORKS_IF_EXISTS
81
82will disable network recreation, which can be needed in case of changing network setup.
83By default set to `false`, to prevent network recreation in case of rebuilding nodes. If
84you need to recreate networks set it to true or manually destroy existing networks.
Denis Egorenkoc2656402019-04-19 18:17:50 +040085
86Also if you are not going to use system bridges, set next parameters to true:
87
Denis Egorenko6cb60522019-07-17 21:36:52 +040088 * export VM_MGM_BRIDGE_DISABLE=true
89 * export VM_CTL_BRIDGE_DISABLE=true
90 * export VM_PUBLIC_BRIDGE_DISABLE=true
Denis Egorenkoc2656402019-04-19 18:17:50 +040091
92This will switch using to locally created virsh networks.
93
94Script will check that disk and cfg01 config-drive are present and then prepare config-drive for all-in-one node.
Denis Egorenkobcf88892019-04-26 19:45:30 +040095Start VM with ``virsh start <SLAVE_VM_NAME>``. Once VM is up and running you can use ``virsh console`` to check what is
96going on during bootstrap. For that VM will be used same fail safe user as specified for cfg01.
Denis Egorenkodcc233d2019-03-06 18:09:24 +040097
Denis Egorenkof7aaccf2019-02-26 13:47:25 +040098Deploy cfg01 on Mac OS with VirtualBox
99======================================
100
101**Prerequisites**
102
103Recommended VirtualBox version is 5.2.26, with Extenstion pack for the same version:
104
105 * Get VirtualBox package for your system: https://download.virtualbox.org/virtualbox/5.2.26/
106 * Extension pack: https://download.virtualbox.org/virtualbox/5.2.26/Oracle_VM_VirtualBox_Extension_Pack-5.2.26.vbox-extpack
107 * Python JSON module
108
109**Common info**
110
111Script gives you an ability to deploy cfg01 VM with provided cfg01 VDI disk
112image and config-drive iso file on your local laptop.
113
114Script takes as arguments two URLs: for cfg01 disk image and for config-drive ISO file.
115Both arguments are required in specified order. All other parameters are optional and can
116be overrided by exporting them via 'export' command or by creating in script's
117run directory env file 'env_overrides' with next possible arguments:
118
119 * VM_NAME - the name of VM to be created in VirtualBox. Default: 'cfg01-mcp.local'.
120 * VM_DISK - the name of virtual disk to be used for virtual machine. Can be
121 an absolute path as well. This variable will be used as target file name for
122 downloading virtual machine disk, please be sure that path exists.
123 Default: 'cfg01-disk.vdi'
124 * CONFIG_DRIVE_ISO - same as VM_DISK, but for config-drive ISO file.
125 Default: 'cfg01.deploy-local.local-config.iso'
126 * AUTO_USER_CONFIRM - do not ask user confirmation to override some resource if already exists.
127 Default: false
128 * UPDATE_ISO_INTERFACES - Update network settings in provided config-drive ISO file.
129 The target and main hosts, which is used to deploy cfg01 instance, are based under
130 OS Linux family and QEMU/KVM virtualization and virtio net-driver. Xenial system, which
131 used for cfg01, already contains a new SystemD predictable network interface names mechanism [0],
132 which automatically assigns ens[3-9] interface names for VMs. VirtualBox is using multi-functional
133 network card, which leads to renaming all network interfaces to enp0s* names.
134 [0] https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
135 Default: true
136
137 * DEPLOY_NET_NAME - NAT-Service network name, which is used as primary interface for cfg01. This network
138 doesn't provided direct access to VM, it is possible to add manually port forwarding rules if needed, but
139 for VM access use host-only network CONTROL_NET. Default: 'deploy_nat_network'
140 * DEPLOY_NETWORK - NAT-Service network with CIDR to use. Should be same as on model generation
141 step 'networking'. Default: '192.168.15.0/24'
142 * DEPLOY_GATEWAY - NAT-Service network gateway. Should be same as on model generation step 'networking'.
143 Default: '192.168.15.1'
144 * DEPLOY_IP_ADDRESS - Primary deploy IP address, which is also specified during model generation.
145 Default: '192.168.15.15'
146
147 * CONTROL_NET_NAME - Host-only based network name, which has static names 'vboxnetX', where 'X' is simple
148 count of existing networks for such type. Default: 'vboxnet0'
149 * CONTROL_GATEWAY - Host-only based network gateway. Default: '192.168.56.1'
150 * CONTROL_NETWORK - Host-only based network with CIDR to use. Should be same as on model generation
151 step 'networking'. Default: '192.168.56.0/24'
152 * CONTROL_IP_ADDRESS - Control IP address, which is also specified during model generation.
153 Default: '192.168.56.15'
154
155Script will go through next steps:
156
157 * Download disk image and config drive ISO;
158 * Define virtual machine with provided parameters;
159 * If needed config-drive ISO network data will be updated on a fly;
160 * Run virtual machine.
161
162Once 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 +0400163It will drop all logs into console and it doesn't matter loged in user or not. It is recommended to specify
164username and password during model generation for login via VM console if something goes wrong.
Denis Egorenkof7aaccf2019-02-26 13:47:25 +0400165Once you are logged in you can follow usual debug procedure for cfg01 node.