Difference between revisions of "VSphere"

From 24PinTech Wiki
Jump to navigation Jump to search
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
== vSphere/vCenter ==
== vSphere/vCenter ==
vSphere is VMWare's virtualization platform and a central planning/management area to work on VMWare products. In vSphere, we use vCenter to connect all of our [[ESXi]] hosts together and manage them all from a single place. vSphere also adds other services such as vSphere Replication to the environment which allows us to take daily replications of our VMs. vSphere is located on a virtual machine on 10.21.25.2 called Yggdrasil. It can be accessed at <nowiki>https://10.21.25.5</nowiki> with the login [email protected] and the highest level pintech password.
vSphere is VMWare's virtualization platform and a central planning/management area to work on VMWare products. In vSphere, we use vCenter to connect all of our [[ESXi]] hosts together and manage them all from a single place. vCenter is located on a virtual machine on 10.21.25.2 called Yggdrasil. It can be accessed at <nowiki>https://10.21.25.5</nowiki> with the login [email protected] and the highest level pintech password or using your personal account with @mhs.24pin.tech. vSphere also adds other services such as vSphere Replication to the environment which allows us to take daily replications of our VMs.  


=== Installing ===
=== Installing ===


* The location of the installer can be found \\10.21.25.13/Cisco Curriculum/vSphere Downloads/VMware-VCSA-all-7.0.3-18778458/vcsa-ui-installer/win32/installer
* Before starting, you will need to have atleast one ESXi host to be able to install vCenter.
* When you first open up the installer you're given four options: install, upgrade, migrate, and restore.
*Download the latest version of VMware vCenter Server Appliance 7 for Essentials Plus from VMWare's [https://customerconnect.vmware.com/downloads/ customer connect site] using chamberlain's account.
* From here you just follow the steps to installation. You will need to have a ESXi machine running to be able to install vCenter.
* Run the installer and choose the install option. From here, simply follow the steps in the installer to finish the installation.


=== Updating ===
=== Updating ===
*To start the update process you want to go and head over to the vCenter management web interface at https://yggdrasil.mhs.24pin.tech:5480/#/login.
*To start the update process you want to go and head over to the vCenter management web interface at https://yggdrasil.mhs.24pin.tech:5480/#/login.
*Go to the update section of the page and wait for the available updates to load.
*Go to the update section of the page and wait for the available updates to load.
*I would choose the latest update available or if you are looking for a specific update you can mess with the update selection settings.
*Select backup now and check the box that says use the scheduled update settings. From there you will just need to put in the highest level password and continue.
*When you go to update it will do two things, it will ask you to make a backup, and it will check the database health. For the backups you can select backup now and check the box that says use the scheduled update settings. From there you will just need to put in the ITX password and continue. Now if you run into a issue with the database health you will have to refer to the article found in helpful links.
*When starting the update, it may take anywhere from 30 minutes to several hours. Downtime is not required for the ESXi hosts that vCenter is managing, or for virtual machines that are running on the hosts. Only vCenter will be down and should start back up on it's own after the update.
*When it gives you the option to start the update it might take a while, this is fine since the vCenter should start back up and resume on it's own.
*When updating, downtime is not required for the ESXi hosts that vCenter Server is managing, or for virtual machines that are running on the hosts.
==vSphere Replication==
vSphere Replication is a appliance offered by VMWare for their vCenter servers. We have it setup so that our vSphere replication appliance and vCenter are both on Asgard. You can choose which VMs you want to replicate and how often they sync/replicate so you can restore to a previous version if something ever goes wrong. Replications can be accessed at 10.21.25.26 using [email protected] and the highest level password. Once you are in, you can view the replications by clicking view details and then the pressing the replication tab.


=== Installation ===
== Virtual Machines ==
(The process can also be followed at https://youtu.be/Y5idS2Z4ugs though our setup is slightly different because we only have one vCenter.) The entire installation process should be done via the vCenter console ([http://10.21.25.5/ 10.21.25.5]) and you will deploy the machine using [https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vm_admin.doc/GUID-AE61948B-C2EE-436E-BAFB-3C7209088552.html OVF files]. We have the replication ISO saved on \\midgard\Cisco Curriculum\vSphere Downloads\VMWare-vSphere_Replication-8.3.1-17210339. The process can be followed here:
#To deploy a vSphere Replication machine you want to make sure you are in the hosts section of vCenter and you want to right click the machine you are deploying the appliance on and choose "Deploy OVF Template."
#It will ask you to choose local files for setup. You want to choose the following files (vSphere_Replication_OVF10.ovf, vSphere_Replication-support.vmdk, vSphere_Replication-system.vmdk)
#The next couple of steps are self explanatory. It will ask for a name and folder. I would use the naming scheme vSphereReplication (the name of the machine the appliance is on.) As for the folder press the drop down and choose Discovered Virtual Machines.
#Compute resource is the machine that will be hosting the appliance. This is where the appliance will get it's resource pool from.
#Agree to the license agreements and press next. You will be asked if you want to deploy with 2vCPUs or 4vCPUs. I would choose 2vCPUs as 4 is overkill for our small network.
# Next it asks where you want to store the files for the appliance. I chose the local machine datastore for both of the appliances we have in our network, but you can also choose remote machines for more redundancy.
#For the networking machine choose the management network for the machine you are deploying on and keep it as static-manual IPv4.
#This next step you will be actually choosing the configuration for the machine. The configuration I used was:
##Password - (Your Choice)
##NTP Server - 10.21.25.3
## Hostname - vSphereReplicationValhalla
##Default Gateway - 10.21.25.1
##Domain Name & Domain Search Path - Yggdrasil.mhs.24pin.tech (this will typically be the central vCenter along with your domain name)
## Domain Name Servers - 10.21.25.3
##Management IP Address - 10.21.25.25 (The IP address you will use to configure the appliance)
##Management Network Netmask - 255.255.255.0
#The next two pages are just agreements and making sure these are the right settings.
#Once you confirm the machine will start deploying the OVF and you can see the progress below.
#'''When the machine is done make sure to start the machine up for the first time on the vCenter (10.21.25.5). I don't know why but if you turn on the machine for the first time on the ESXi machine the OVF doesn't get deployed right.'''
#Once the machine boots up and says you can manage it from the web interface go ahead and do so. The login should be root and the password you set. Now that you are in the web interface there will be a little more that you need to setup. You'll need to edit both VR>Configuration and Network>Address before you are able to start running the service. Our configuration can be found in the screenshots below.
#I had to change some things in the Configuration tab and the Address tab. The main things for those were changing the VRM Site Name to the name of the appliance, the Lookup Service Address to the domain name for the vCenter, and the DNS servers for the networking. If you don't do these correctly the service may not start and you may get a lookup service error.
#Once you have inputted all of your information you will be able to head back over to the VR>Configuration tab and press the Save and Restart Service. You have successfully deployed vSphere Replication Appliance.
#If you have rebuilt the replications VM make sure to delete any old replications from the datastore so it doesn't waste tons of space.
=== '''Replicating''' ===
*For the target site choose manually select and then select vSphereReplicationAsgard
*Choose the machine you want to replicate
*For the target datastore choose the opposite of what the machine is currently on
*Change the replication time to every 24 hours
*Press finish to start the initial sync of the machine (you can check the progress of the replication by using the drop down)


=== '''Restoring''' ===
=== Creating a VM ===
*Right click the machine you want to restore and then press the recover button
Right click on one of the hosts and press new virtual machine to begin creating a new virtual machine:
*When choosing you recovery options you want to use the latest available data if it is a restoration of a broken machine, or in very small cases sync most available data for other reasons.  Also make sure the machine doesn’t turn on at start, this is for later.
*For the machine you want to choose the opposite of what the current machine is on (example: the web server is on Valhalla so we would choose Asgard) and then press finish.
*Mark the checkbox next to the VM Network option in the VM settings if it is not connecting to the network.
*When finished, be sure to always change the name of the broken server and the working one to easily differentiate them.
*Once you restore a machine you have to make sure you delete the replication and then create it again for the new working machine.


== vMotion ==
* Select how you want to create a virtual machine. Typically we will use the first option of creating a new virtual machine.
This is a core feature to the VMware environment and allows machine to migrate over between ESXi boxes with zero down time. In order to configure vMotion you need to have two available IP addresses in your reservation range.
* Give the VM a name and then select the host that you want to put the VM on.
* Select the default storage that shows up (either ValhallaLocal or AsgardLocal)
* Select the operating system that you wish to use and then pick the version.
* Choose the amount of cpus, memory, and and storage that you will need to use for the virtual machine.  
* To install the operating system you also need to pick Datastore ISO File in CD/DVD Drive and check connect at power on.


=== Migrating ===
=== Migrating a VM (vMotion) ===
* Login into your vCenter/vSphere appliance and find the machine you want to move over with zero downtime
vMotion is a core feature to the VMware environment and allows machine to migrate over between ESXi boxes with zero down time. In order to configure vMotion you need to have two available IP addresses in your reservation range.
* Find the machine you want to move over with zero downtime
* Right click the machine and press on the Migrate option
* Right click the machine and press on the Migrate option
* Choose to change both computer resource and storage
* Choose to change both computer resource and storage
Line 69: Line 35:
* Choose the networking group the machine we part of, which should usually be the default port group depending on the machine.
* Choose the networking group the machine we part of, which should usually be the default port group depending on the machine.


==Snapshots==
===Snapshots===
Snapshots are short term restore options that can be created before you apply major updates or changes to a virtual machine. It allows you to create multiple restore points of your virtual machine as you go through the update process. Snapshots must be deleted to update the storage of any VM.
Snapshots are short term restore options that can be created before you apply major updates or changes to a virtual machine. It allows you to create multiple restore points of your virtual machine as you go through the update process. Snapshots must be deleted to update the storage of any VM. Snapshots should be created at least once a month or before any major updates/changes to a machine.


=== Creation ===
==== Creation ====


* Select the VM you want to create a snapshot of and navigate to the snapshot tab.
* Select the VM you want to create a snapshot of and navigate to the snapshot tab.
Line 79: Line 45:
*Uncheck VM memory when taking snapshots of Yggdrasil or vSphereReplication
*Uncheck VM memory when taking snapshots of Yggdrasil or vSphereReplication


=== Reverting ===
==== Reverting ====
*Select the VM you want to create a snapshot of and navigate to the snapshot tab.
*Select the VM you want to create a snapshot of and navigate to the snapshot tab.
*Click on the snapshot you want to revert to and then press finish to restore the VM to the snapshot.
*Click on the snapshot you want to revert to and then press finish to restore the VM to the snapshot.
*Once you have fixed the issue, make sure to delete that snapshot and then create a new snapshot for the latest version.
*Once you have fixed the issue, make sure to delete that snapshot and then create a new snapshot for the latest version.
==vSphere Replication==
vSphere Replication is a appliance offered by VMWare for their vCenter servers. We have it setup so that our vSphere replication appliance and vCenter are both on Asgard. You can choose which VMs you want to replicate and how often they sync/replicate so you can restore to a previous version if something ever goes wrong. Replications can be accessed at 10.21.25.26 using [email protected] and the highest level password. Once you are in, you can view the replications by clicking view details and then the pressing the replication tab.
=== Installation ===
*To deploy a vSphere Replication machine you want to make sure you are in the hosts section of vCenter and you want to right click the machine you are deploying the appliance on and choose "Deploy OVF Template."
*It will ask you to choose local files for setup. For the setup, select the following files vSphere_Replication_OVF10.ovf, vSphere_Replication-support.vmdk, and vSphere_Replication-system.vmdk from \\midgard\Cisco Curriculum\vSphere Downloads\VMWare-vSphere_Replication-8.3.1-17210339
*Name the VM vSphereReplication and for the folder press the drop down and choose Discovered Virtual Machines.
*Agree to the license agreements and choose to deploy with 2 vCPUs.
* Next, choose the local machine datastore for both of the appliances we have in our network.
*For the networking machine choose the management network for the machine you are deploying on and keep it as static-manual IPv4.
*Choose the [https://docs.google.com/document/d/1Gf5gtAfNwkZgOogfzz0wzIFiiWA5Bs1wjLkq4wUFGkg/edit?usp=sharing configuration] for the machine and then deploy the OVF.
*Once the machine boots up and says you can [https://docs.google.com/document/d/1Gf5gtAfNwkZgOogfzz0wzIFiiWA5Bs1wjLkq4wUFGkg/edit?usp=sharing configure] it from the web interface go ahead and do so (login should be root and the password you set)
*When finished, go to the VR>Configuration tab and press the Save and Restart Service.
*If you have rebuilt the replications VM make sure to delete any old replications from the datastore so it doesn't waste tons of space.
=== '''Replicating''' ===
*For the target site choose manually select and then select vSphereReplication
*Choose the machine you want to replicate
*For the target datastore choose the opposite of what the machine is currently on
*Change the replication time to every 24 hours
*Press finish to start the initial sync of the machine (you can check the progress of the replication by using the drop down)
=== '''Restoring''' ===
*Right click the machine you want to restore and then press the recover button
*When choosing recovery options you want to use the latest available data if it is a restoration of a broken machine and make sure the machine doesn’t turn on at start.
*For the machine you want to choose the opposite of what the current machine is on (for example: the web server is on Valhalla so we would choose Asgard) and then press finish.
*Mark the checkbox next to the VM Network option in the VM settings if it is not connecting to the network.
*Be sure to always change the name of the broken server and the working one to easily differentiate them.
*Once you restore a machine you have to make sure you delete the replication and then create it again for the new working machine.
==Troubleshooting==
==Troubleshooting==
Changing root password:
*To change the password of the root user, access Asgard and open Yggdrasil in the console.
*From here, enter the root user and password to login.
*Once you have logged in, type ''shell'' and then type ''passwd'' to create a new password.
Other possible fixes:
*https://vmware.github.io/photon/assets/files/html/3.0/photon_troubleshoot/resetting-a-lost-root-password.html Changing root password (no password)


*https://docs.vmware.com/en/vSphere-Replication/8.5/com.vmware.vsphere.replication-admin.doc/GUID-C987AD18-7C2D-4FA6-B6E4-6B0DDA915A7A.html (Entire VMware wiki for vSphere Replication)
=== Potential Issues/Fixes ===
 
* Cant change root password:
#To change the password of the root user, access Asgard and open Yggdrasil in the console.
#From here, enter the root user and password to login.
#Once you have logged in, type ''shell'' and then type ''passwd'' to create a new password.
*Changing root password (no password) - https://vmware.github.io/photon/assets/files/html/3.0/photon_troubleshoot/resetting-a-lost-root-password.html  


* https://kb.vmware.com/s/article/2106709 (Checking the OVF files of the machine and if they are working)
* Checking the OVF files of the machine and if they are working - https://kb.vmware.com/s/article/2106709  
*https://vmware.github.io/photon/assets/files/html/3.0/photon_troubleshoot/resetting-a-lost-root-password.html (Lost password)
*Lost Password - https://vmware.github.io/photon/assets/files/html/3.0/photon_troubleshoot/resetting-a-lost-root-password.html  
*https://serverfault.com/questions/459948/how-to-change-vcenter-server-appliance-ip-from-command-line (Changing the IP interface if you can't access it)
*Changing the IP interface if you can't access it - https://serverfault.com/questions/459948/how-to-change-vcenter-server-appliance-ip-from-command-line  
*https://williamlam.com/2020/11/why-am-i-seeing-http-communication-status-404-error-when-configuring-vsphere-with-tanzu-how-to-fix.html (404 error)
*404 Error - https://williamlam.com/2020/11/why-am-i-seeing-http-communication-status-404-error-when-configuring-vsphere-with-tanzu-how-to-fix.html  
*https://kb.vmware.com/s/article/2054994 #VMware documentation on the setup (ew)
*VMware documentation on the setup - https://kb.vmware.com/s/article/2054994

Latest revision as of 16:20, 9 May 2023

vSphere/vCenter

vSphere is VMWare's virtualization platform and a central planning/management area to work on VMWare products. In vSphere, we use vCenter to connect all of our ESXi hosts together and manage them all from a single place. vCenter is located on a virtual machine on 10.21.25.2 called Yggdrasil. It can be accessed at https://10.21.25.5 with the login [email protected] and the highest level pintech password or using your personal account with @mhs.24pin.tech. vSphere also adds other services such as vSphere Replication to the environment which allows us to take daily replications of our VMs.

Installing

  • Before starting, you will need to have atleast one ESXi host to be able to install vCenter.
  • Download the latest version of VMware vCenter Server Appliance 7 for Essentials Plus from VMWare's customer connect site using chamberlain's account.
  • Run the installer and choose the install option. From here, simply follow the steps in the installer to finish the installation.

Updating

  • To start the update process you want to go and head over to the vCenter management web interface at https://yggdrasil.mhs.24pin.tech:5480/#/login.
  • Go to the update section of the page and wait for the available updates to load.
  • Select backup now and check the box that says use the scheduled update settings. From there you will just need to put in the highest level password and continue.
  • When starting the update, it may take anywhere from 30 minutes to several hours. Downtime is not required for the ESXi hosts that vCenter is managing, or for virtual machines that are running on the hosts. Only vCenter will be down and should start back up on it's own after the update.

Virtual Machines

Creating a VM

Right click on one of the hosts and press new virtual machine to begin creating a new virtual machine:

  • Select how you want to create a virtual machine. Typically we will use the first option of creating a new virtual machine.
  • Give the VM a name and then select the host that you want to put the VM on.
  • Select the default storage that shows up (either ValhallaLocal or AsgardLocal)
  • Select the operating system that you wish to use and then pick the version.
  • Choose the amount of cpus, memory, and and storage that you will need to use for the virtual machine.
  • To install the operating system you also need to pick Datastore ISO File in CD/DVD Drive and check connect at power on.

Migrating a VM (vMotion)

vMotion is a core feature to the VMware environment and allows machine to migrate over between ESXi boxes with zero down time. In order to configure vMotion you need to have two available IP addresses in your reservation range.

  • Find the machine you want to move over with zero downtime
  • Right click the machine and press on the Migrate option
  • Choose to change both computer resource and storage
  • Choose the machine you are migrating the machine to by dropping down the cluster. When doing this you may get an error or two, usually this is due to the fact some sort of device is attached to the VM and you just need to go and configure the VM to make sure no external devices are attached.
  • Choose the datastore. Here you can verify that you chose the right machine since you should only have one option, either ValhallaLocal or AsgardLocal.
  • Choose the networking group the machine we part of, which should usually be the default port group depending on the machine.

Snapshots

Snapshots are short term restore options that can be created before you apply major updates or changes to a virtual machine. It allows you to create multiple restore points of your virtual machine as you go through the update process. Snapshots must be deleted to update the storage of any VM. Snapshots should be created at least once a month or before any major updates/changes to a machine.

Creation

  • Select the VM you want to create a snapshot of and navigate to the snapshot tab.
  • Press take snapshot to create a snapshot (write why the snapshot is being taken in the description)
  • Uncheck VM memory when taking snapshots of Yggdrasil or vSphereReplication

Reverting

  • Select the VM you want to create a snapshot of and navigate to the snapshot tab.
  • Click on the snapshot you want to revert to and then press finish to restore the VM to the snapshot.
  • Once you have fixed the issue, make sure to delete that snapshot and then create a new snapshot for the latest version.

vSphere Replication

vSphere Replication is a appliance offered by VMWare for their vCenter servers. We have it setup so that our vSphere replication appliance and vCenter are both on Asgard. You can choose which VMs you want to replicate and how often they sync/replicate so you can restore to a previous version if something ever goes wrong. Replications can be accessed at 10.21.25.26 using [email protected] and the highest level password. Once you are in, you can view the replications by clicking view details and then the pressing the replication tab.

Installation

  • To deploy a vSphere Replication machine you want to make sure you are in the hosts section of vCenter and you want to right click the machine you are deploying the appliance on and choose "Deploy OVF Template."
  • It will ask you to choose local files for setup. For the setup, select the following files vSphere_Replication_OVF10.ovf, vSphere_Replication-support.vmdk, and vSphere_Replication-system.vmdk from \\midgard\Cisco Curriculum\vSphere Downloads\VMWare-vSphere_Replication-8.3.1-17210339
  • Name the VM vSphereReplication and for the folder press the drop down and choose Discovered Virtual Machines.
  • Agree to the license agreements and choose to deploy with 2 vCPUs.
  • Next, choose the local machine datastore for both of the appliances we have in our network.
  • For the networking machine choose the management network for the machine you are deploying on and keep it as static-manual IPv4.
  • Choose the configuration for the machine and then deploy the OVF.
  • Once the machine boots up and says you can configure it from the web interface go ahead and do so (login should be root and the password you set)
  • When finished, go to the VR>Configuration tab and press the Save and Restart Service.
  • If you have rebuilt the replications VM make sure to delete any old replications from the datastore so it doesn't waste tons of space.

Replicating

  • For the target site choose manually select and then select vSphereReplication
  • Choose the machine you want to replicate
  • For the target datastore choose the opposite of what the machine is currently on
  • Change the replication time to every 24 hours
  • Press finish to start the initial sync of the machine (you can check the progress of the replication by using the drop down)

Restoring

  • Right click the machine you want to restore and then press the recover button
  • When choosing recovery options you want to use the latest available data if it is a restoration of a broken machine and make sure the machine doesn’t turn on at start.
  • For the machine you want to choose the opposite of what the current machine is on (for example: the web server is on Valhalla so we would choose Asgard) and then press finish.
  • Mark the checkbox next to the VM Network option in the VM settings if it is not connecting to the network.
  • Be sure to always change the name of the broken server and the working one to easily differentiate them.
  • Once you restore a machine you have to make sure you delete the replication and then create it again for the new working machine.

Troubleshooting

Potential Issues/Fixes

  • Cant change root password:
  1. To change the password of the root user, access Asgard and open Yggdrasil in the console.
  2. From here, enter the root user and password to login.
  3. Once you have logged in, type shell and then type passwd to create a new password.