In this chapter, we will cover the following recipes:
# -
Categorizing objects in the environment
Basically using tagging feature tags are label containing meta data tags are attached to vsphere objects like datastore clusters this makes it searchable and sortable while scripting
Note: For example, administrators can categorize virtual machines by a guest OS
, or datastores by their characteristics, such as storage speed, redundancy, and so on. #get-datastore -tag RAID10 # Scheduling the VM clone vCenter tasks scheduler doest do cloning this needs to be done by powercli + windows task scheduler In the Program/script field type the following path: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files(x86)\VMware\Infrastructure\vSphere PowerCLI"\vi m.psc1 -command "&{<path to Power Shell script>}" -PSCONSOLE <path to the script> #Redirecting VMkernel dumps to another server vSphere 5 has introduced VMware vSphere Network Dump Collector. - Use cases : Esxi with no local storage or esxi with local storage failure caus e loss of dump on local drive -Dump Collector is available as a Windows service and has to be installed separa tely. -It can be installed on the same server as vCenter Server. -It comes with the vCenter Server Virtual Appliance. Requirements - ESXi host administrative access is required to enable the feature. - Core dumps will be sent using the Netdump protocol, which supports only IPv4. - Network traffic is not encrypted; it uses UDP/6500 by default. - Netdump does not support any authentication or authorization mechanisms, so there is no way to verify the integrity or validity of the data collected. - Network Dump Collector is incompatible with VMkernel ports configured for Ethe rChannel/LACP. - Netdump Collector is not supported on vSphere Distributed Switch. - By default, only 2 GB of diagnostic information is stored and older dumps are deleted. - The default timeout to receive files is 60 seconds. Any partial files are dele ted once it expires. Unfortunately, this value is not configurable. # How to enable it - MAke chanegs to vmconfig-netdump.xml located at C:\ProgramData\VMware\VMware E SXi Dump Collector\ An administrator can change: - defaultDataPath: This is the value that defines a folder where dumps will be s tored
- port: This is the UDP port the service is listening on
- maxSize: This is the amount of disk space allocated to core dumps in GB - After changes restart net stop vmware-network-coredump net start vmware-network-coredump - Finally enable it on esxi host via host profile ## Gathering network traffic Traffic which can be collected includes the following: VM-to-VM traffic within one host VM-to-VM traffic between hosts VM to physical network traffic - this is done via Netflow collectors in VDS environment - this can be enabled at port level or portgroup level. - Timeouts define how often gathered data is sent to the NetFlow collector Active flow export timeout Idle flow export timeout Idle flow export timeout is used to ensure that finished flows are being sent to the collector periodically. - Note : The sampling rate defines the amount of information collected for a flo w, for example, a rate of 1 means that data from every second packet will be collected. - A rate of x means that x number of packets will be dropped after each collecte d packet. - Internal flows are the network activity between virtual machines running on th e same host. When this setting is chosen, only such traffic will be collected. # VDS configuration backup and restore Import Export is possible via webclient only # Management network configuration recovery # Choosing a MAC address prefix By default vCenter keeps mac address prefix for all the VM it manages - this can an issue with P2V converted VM - Software license is tied with MAC address - in this case Mac change is required in the GUEST as well # Getting familiar with the new CLI # Configuring the firewall from CLI # Bypassing "hostd" when it's unresponsive with CLI Improving visibility with e-mail alerts Controlling the space used by snapshots Controlling datastore space utilization - use SDRS - Setup storage alarms - Create folder and add datastore in it - then set up alarm definition
ff Automating VM placement with storage profiles
ff Automating VM placement with VM affinity Two types of affinity rules can be created: - VM-to-Host, which controls whether particular groups of VMs can be placed on certain hosts. - VM-to-VM, which define whether VMs can be kept together on the same host. One of the more common use cases for affinity rules is -- performance considerations when certain resource-intensive VMs should be run only on hosts with enough resources. -- scenario is related to license restrictions. For example, MS SQL virtual mach ines licensed for two processors should be placed on hosts with no more than two CPUs. ff Automating VM placement with storage affinity ff Automating tasks with a scheduler ff Keeping hosts up to date