Getting started vmware apps
-
Upload
rickyelqasem -
Category
Technology
-
view
5.857 -
download
0
description
Transcript of Getting started vmware apps
www.virtualizeplanet.com
Author: Ricky El-Qasem: 2011
Virtualize Planet
Getting Started, writing VMware APPs for novice programmers
Sponsored by
04/09/2023 2
Breaking the magicians code
04/09/2023www.virtualizeplanet.com 3
No Programmers Allowed
I’m not a programmer
I do not speak in Fortran or C++
The point of this session is that its for novices like me
04/09/2023www.virtualizeplanet.com 4
A word from the sponsors
All apps mentioned in this presentation are not the products of Canopy Cloud. Ricky developed these apps before joining Canopy.
Canopy Private Cloud
Canopy Appstor
e
Solutions Catalogue: Vertical & Horizontal Workloads
Management & Orchestration vCloud Director - vSphere
Canopy Cloud InfrastructureVblock - Best-of-Breed
04/09/2023www.virtualizeplanet.com 5
My Apps
VPsnapper = where it all started Resource Pool Scheduler vDisk Waste Finder vSphere Plug-in Wizard = Best Free Tools
VMworld 2011 vDisk Informer
04/09/2023www.virtualizeplanet.com 6
Different APIs
COM API Web server API =
SDK PowerCLI Etc etc
04/09/2023www.virtualizeplanet.com 7
What you need before you begin .Net IDE = Visual Studio .Netor Java IDE = Netbeans
04/09/2023www.virtualizeplanet.com 8
So how did I do it?
VPsnapper
I needed a way to revert the default snapshots on all my VMs with one click
+ COM API Document
04/09/2023www.virtualizeplanet.com 9
VPSnapper
04/09/2023www.virtualizeplanet.com 10
The SDK is the future Resource Pool
Scheduler•Student gave me an idea. I needed to be able to shift resource allocation from pool to pool• Once again I used the book and the SDK programmers guide but failed at stage 1• Stage 1 was to list all VMs running• I posted my failure on VMTN = VMware Communities• Few days later VMware sent me a fixed version of my test app.• This was a huge springboard
04/09/2023www.virtualizeplanet.com 11
Another Useful Book
Samples are in JAVA
However I found I could easily copy from JAVA to C# .NET
04/09/2023www.virtualizeplanet.com 12
The SDK Tree
ExtensibleManagedObject
ManagedEntity
ResourcePool
ComputeResource
Hostsystem
Datacenter Folder VirtualMachine
ClusterComputeResource
04/09/2023www.virtualizeplanet.com 13
MOB = Managed Object Browser
https://yourserver/mob
04/09/2023www.virtualizeplanet.com 14
How to work with the SDK
Make a connection Filter only what you need – Proprerty Spec Which hierarchy objects to search -
Traversal Spec
04/09/2023www.virtualizeplanet.com 15
VIMAPI in .net
2 x Dlls – import in to your code
Using Statement:
04/09/2023www.virtualizeplanet.com 16
MOREF Managed Object Reference You do not manipulate the VMware
objects like VMs, Folders, Hosts and Datastores directly
You work with a representation of those objects known as a Managed Object Reference aka MOREF
Its all about the MOREF!
04/09/2023www.virtualizeplanet.com 17
Data model
Managed Object Types = objects that have properties and methods
MOREF = local representation Data Object = just pure data and no
actions
04/09/2023www.virtualizeplanet.com 18
vSphere Plug-in Wizard
Finalist in Best Free vSphere Tools VMworld 2011
Plugs in Website of your choice into vSphere Client
04/09/2023www.virtualizeplanet.com 19
vSphere Plug-in Wizard
04/09/2023www.virtualizeplanet.com 20
vDisk Informer
Helps you find wasted vDisk space
Helps you find misaligned vDisks
Use Gparted to fix
04/09/2023www.virtualizeplanet.com 21
vDisk Waste Finder
Previous version of vDisk Informer
VMUG can have copy of code.
Demo
04/09/2023www.virtualizeplanet.com 22
Extreme GUI Makeover
Before After
04/09/2023www.virtualizeplanet.com 23
Tips on creating a sexy GUI
04/09/2023www.virtualizeplanet.com 24
Tips on creating a sexy GUI
04/09/2023www.virtualizeplanet.com 25
Tips on creating a sexy GUI
04/09/2023www.virtualizeplanet.com 26
04/09/2023www.virtualizeplanet.com 27
Writing Config
04/09/2023www.virtualizeplanet.com 28
Performing an action
ManagedObjectReference moref_task = _service.PowerOffVM (moref_VM, moref_Host);
04/09/2023www.virtualizeplanet.com 29
My best tip as a novice
Take an existing example and hack it to death with trial and error until you get it working for your needs
If something doesn’t work post it on VMware's Community forum
After today code for vDisk Waste Finder will be available from my blog www.virtualizeplanet.com
04/09/2023 30
Disclaimer:
Virtualize Planet will not be held liable for any actions you perform in your environment. Anything you learn from this material should be used at your own discretion and be warned actions you perform can be damaging. Always consult a professional.
www.virtualizeplanet.com