Managing Virtual Machines Using The VMware Virtual Infrastructure SDK .

Transcription

Managing Virtual Machines Usingthe VMware Virtual InfrastructureSDK with Dell OpenManage andAltiris Deployment SolutionDave Jaffe and Todd MuirheadMichael HopkinAltiris, Inc.

Introduction VMware is great but how do you manage allyour ESX Server hosts and virtual machines? Automated installation of ESX Server Just like you have tools to install any OS Virtual machine management Traditional management challenges (How to create virtualmachines, install OSes, apply patches) New challenges stemming from this new pool of computeresources (load balancing, failover, cloning) Answer: Virtual Center scripting thirdparty tools

Management Solutions For VMware Dell offers several approaches toVMware management Use of VMware virtual infrastructure SDK scripts,either standalone or in combination with othertools such as Dell OpenManage software Use of third party tools such as Altiris Deployment Solution for Dell Servers, which workswith the Dell Deployment Toolkit to providemanagement of virtual machines and ESX Server

Dell OpenManage: VMware Integration A technology demonstration to show howscripting can be used with managementtools to provide, in this case, afailover capability Components: IT Assistant: One-to-many mgmt console OpenManage System Administrator: Agentinstalled on server to monitor hardware Version available for ESX Server VMware Virtual Center: Manage virtual machines,run scripts using web services interface

Dell OpenManage: VMware Integration,cont. Virtual Center script: VMALL When called, moves all virtual machines offspecified ESX Server host to other hosts in farmin load-balanced fashion Called by IT Assistant when error or warning isdetected on an ESX Server host For ions/OM-VMware-Integration.pdf

enManagealertbalanced)VirtualCenterVMotionlive terVMware VirtualCenterOne-to-Many VirtualMachine ManagementVM1VM VM VM234ESX ServerSAN Configurationto enable VMotionVMESX ServerVMVMVMVMESX ServerDell EMC SANVMVMESX ServerApplicationVMIT Assistant:One-to-Many ystemVirtualMachineESX ServerVirtualization Layer: VMware ESX ServerVMware ESX Server on Dell PE6650s

Slide 7FBP1Felipe to turn into build slide to explain the rationale behind the best practice configFelipe Payet, 4/12/2004

VMALL Script Details Moves virtual machines sequentially from aspecified ESX Server host to the least loadedhost in ESX Server farm First need to turn on performance counters To the vmaConfig.xml configuration file add thefollowing line anywhere between the subject and /subject tags: periodicPerfRefreshEnable true /periodicPerfRefreshEnable Then restart the VMware VirtualCenter Webserviceservice from the Windows services control panel

VMALL: Perf Counter Codestring perfhandle vma .ResolvePath("/perf/0000000060");vc vma .GetContents(perfhandle);c (Container) vc.body;items c.item;for (i 0; i items.Length; i ){if (items[i].type.ToString() "PerfCollection"){vc vma .GetContents(items[i].key);stats (PerfCollection) vc.body;for (j 0; j stats.source.Length; j ){vc vma .GetContents(stats.source[j].key);if (vc.body.GetType().ToString() "VMware.vma.Host"){host (Host) vc.body;if (host.info.hostname hostname){PerfSample[] sample stats.source[j].sample;PerfStat[] sample stats sample[0].stat;

VMALL: Perf Counter Code, cont.for (int k 0; k sample stats.Length; k ){PerfStat stat sample stats[k];PerfStatType statType stat.type;if (statType PerfStatType.cpu){CPUPerf data (CPUPerf) stat.data;used string data.used.ToString();used total Convert.ToInt32(used string);} // End if (statType PerfStatType.cpu)} // End loop on k} // End if (host.info.hostname hostname)} // End if (vc.body.GetType().ToString() "VMware.vma.Host")} // End loop on j} // End if (items[i].type.ToString() "PerfCollection")} // End loop on i

VMClone Script Creates clones of a specified virtual machine withhostname, IP address and storage specified in aconfiguration 8.50.165[NewSAN1] For Windows can call Sysprep in script toautomate Windows setup of clone Uses autoprep object (see code, next slide)

VMClone Autoprep CodeAutoprep autoprep new Autoprep();Sysprep sysprep new Sysprep();GuiUnattended guiUnattended new GuiUnattended();guiUnattended.AutoLogon false;guiUnattended.AutoLogonSpecified true;.sysprep.GuiUnattended guiUnattended;LicenseFilePrintData licenseFilePrintData new de "PerServer";licenseFilePrintData.AutoModeSpecified true;.sysprep.LicenseFilePrintData pecified true;.UserData userData new UserData();userData.ComputerName destVMName[i clone];userData.ProductID Specified true;sysprep.UserData userData;.autoprep.sysprep sysprep;autoprep.sysprepSpecified true;.VC vma.CloneVM(srcHandle, parentHandle, destHostHandle,destVMName[i clone], datastore[i clone], autoprep, true);

Scripting Tips Learn how to access web servicedirectly with browser Then determine which commandspull which piece of data Use samples

For Further Info dell.com/vmware For scripts: dave jaffe@dell.com

Altiris Solutions Overview

Key Messages Altiris provides comprehensive management of physicaland virtual environments Altiris solutions have managed virtual machines for some time Altiris 6.5 product version requires specific virtualizationmanagement functions before release Deployment Server 6.5 is the first of these VMware Strategic Partnership Comprehensive Support Statement are%20Statement.pdf New integration with VMware extends the management reach

Altiris Deployment Solution For DellServers: New Features for VMware ESX Server deployment User Interface Integrationwith Virtual Center Patching virtual machines Running VMware scripts asjobs from Altiris console

Managed Virtualization 5 VMware managementscenarios: Altiris server components canexist in a virtual machine Altiris agent installed in virtualmachines Virtual Center integration inAltiris Deployment Server 6.5 ESX Server deployment andhost management Virtual machine specificVirtual Machinesmanagement via VMwareinterfaces (no Altiris agent)ESX Server

Virtual Machine Management SamplesVia Four Different VMware Interfaces Sample jobs leveragedifferent VMwareWhy? interfaces: Flexibility1. DifferentScriptingAPIsmanagementscenarios needpoints of control differentVmCOM Somecustomers are more comfortableVmPerlwith different scripting environments than2. othersVirtualCenterWeb(shellscriptingvs. ServicesCOM vs. Perl)3. Vmware-cmd:OnmanagementESX Servers Virtualmachine-specific4. WorkflowVmkfstools:ESXNeedServersin thecontinuity:formanagementbefore an Altiris agent is(VMFS create/manage)available Non-Altiris functionality: Virtual machinecreation, start/stop/resume, etc.Why?

Questions?

ThanksDave JaffeSr. Consultant, Product Group Global AlliancesDave Jaffe@Dell.comTodd MuirheadSr. Consultant, Product Group Global AlliancesTodd Muirhead@Dell.comMichael HopkinProduct Managermichael.hopkin@altiris.com

Altiris provides comprehensive management of physical and virtual environments Altiris solutions have managed virtual machines for some time Altiris 6.5 product version requires specific virtualization management functions before release Deployment Server 6.5 is the first of these VMware Strategic Partnership Comprehensive Support Statement