# DIT VMware notes
2024-06-06
https://bsv-vcsa-s1.nerc-bas.ac.uk/
- hardware and structure
- orchestration, provisioning for dev
- free at the point of use, engaging IT for requirements, dev cluster, roll your own
- orchestration, provisioning for IT - spacewalk, puppet, access
# Hardware and Structure
*Visible to elevated users:*
+ There are dev (`AMD Dev`) and production (`AMD Production`, not visible to DIT users) clusters within the VMware estate
+ Also storage platforms (also not visible to us)
+ Networks:
+ Also only visible to elevated users
+ vmware presents a virtual network
*Network card not visible to non-elevated users*
+ (matt) - when James added network connection to my VM, I still couldn't see or select a connection but it was detected as (plugged in)
vSphere Interface:
+ Can view as machines, folders, storage, network - suggest using folder structure generally
+ Currently can only see `Dev`>`Digital Innovation`
+ Network view: 'dev' and 'staging network' - **we don't have privileges here at present** (James to ping service desk re: this)
+ Storage options are redundant
+
Walkthrough:
+ right-click `Digital Innovation` > `New Virtual Machine`
+ can make our own machines (not supported by IT), IT can also make them for us (are supported)
+ `Create a new virtual machine` > give a name, e.g. `bsl-<username>-<some-identifier>`
+ Compute resource: Select a Compute resource, e.g. Dev
+ storage: select storage, prob best to pick one with most free space
+ Compatibility: default
+ OS: Select OS we're likely to use (Recommend Rocky).
+ IT transitioning to Rocky 9 in the future since CentOS is End of Life.
+ Recommend setting OS we'll be running so that VMWare can run optimisations against the guest OS.
+ Will need to select install ISO image further on, it will not show Debian based OS's, so should stick to Rocky.
+ Rocky linux is currently the best selection for BAS IT supportability as CentOS is end of life.
+ Hardware:
+ set some sensible defaults (e.g. 2 CPUs, 4GB mem, 64 GB storage)
+ Change Disk Provisioning to "Thin Provision".
+ If set "Thick Provision" - will reserve all 64GB.
+ Setting "Thin Provision" will expand as needed rather than reserving the full 64GB from the start.
+ Apart from provisioning, we can alter most of the hardware settings.
+ We can alter the number of CPUs allocated to an instance in real-time if it is too low when in use.
+ Remember, for VMs we build ourselves, resources required are mainly for dev and testing, production VMs may get more resources, but we're unlikely to need more.
+ Option available in interface for Video card, but none available in real life.
+ Select a network: 'Dev Network' (also Staging network - don't need to use)
+ New CD/DVD Drive: "Datastore ISO file", `emc0-005` contains the ISO files (in theory), but apart from Matt, David and Bryn cannot access (likely due to a permissions issue).
+ Path to ISO images: `emc0-005/ISOs/*.iso`
+ Choose the latest Rocky image (for instance)
+ Check "Connect At Power On" box.
+ Click `Finish` to complete creation of VM
+ Try to mimic the naming convention used for the VM instance (e.g. if setting up a network interface, or a storage media), this will make it easier to manage and link across different resources.
+ Launching a "Web console" is the same as using the system locally with a keyboard and mouse attached.
+ Anyone can access and view the console - anyone would be able to interact with the console.
+ Preferable to connect via SSH (should be visible with its network name?) (e.g. `ssh bsl-jambyr-r9-test`, `ssh <NAME-OF-VM-INSTANCE>`)
+ Remember to log out of the Web console! Can use it if cannot SSH into it, or if its crashed.
+
# Questions (for end)
+ DW: How ephemeral should VMs be? What do IT expect? Should they be fairly static?
+ As needed, just don't use masses of resources or overallocate
+ DW: Can we create VMs using Ansible/Puppet/whatever?
+ Yes, will be discussed in next meeting.
# Episode 2
2024-06-17
## Provisioning Process?
BAS IT Git repository (contains puppet configurations)
http://git.nerc-bas.ac.uk
BAS Intranet Docs
http://ictdocs.nerc-bas.ac.uk/index.php/Provisioning_Process
BAS GitLab Ansible playbooks
http://gitlab.data.bas.ac.uk/station-data-management/ansible/dit ??
BAS IT will create 'machines/deployments' and they will be provisioned and maintained using puppet/ansible.
## Creating Reproducible Configs (Puppet, Ansible)
Mixture of Puppet & Ansible
Puppet: config management system, IT manage everything via Puppet, there is a puppet agent installed on the vm, looks for puppet server on the network which tells the vm how to configure itself
## Virtual Machines (VMs)
VM Type Designations = Dev, Staging, Production
### Ansible and relation to Puppet
* We do not have visibility of Puppet configuration that IT sets up.
* If IT create Puppet based VM for us, we then create an Ansible playbook that deploys our application onto that VM.
* IT creates the resources & VM.
* Ansible is used as a deployment tool to deploy onto that VM.
* Ansible Steps
A yaml config specifies set of actions (tasks) to reach desirable state.
1. Create host in Ansible.
2. Fill out tasks, will be carried out linearly
3. Import role -
playbook = yaml config in this context