Skip to content

**** ****

Exploring the vCloud Director API

August 14, 2012


In my current job, I monitor the lab environment, educate users on usage of the lab and take user requests to create vApp environments for them to reproduce customer issues.

For the most part because things almost never break it is the education and vApp creation that takes up the bulk of my time.

I don’t know if you have ever used vCloud Director, but creating a vApp requires going through a series of questions, What do you want to call it? What vApp templates do you want to add? Do you want to make new VMs? Do you want to add networking? Do you want static, DHCP or manual Ips? Do you need to configure the vApp network services? Is this all correct?

In any event, I created a standard I follow when I build these environments and I almost always answer the questions the same so that 5-10 min of answering questions can be time consuming over the course of a week. Around a week ago I encountered a slow period where the questions and environments slowed to a drizzle so I decided to take the time to explore the vCD API and see if I could create some tools to make things a bit more stream lined.

First I created a reporting script, it shows me each org, the VM’s within the ORG and active users (an active user counting as a user with a running vApp deployed), VM count, powered on state and datastore usage. After getting my feet wet I decided to dive a little deeper and create a script I could use to deploy a vApp from command line.

Day 1, I was able to create a vApp and add VM’s of my choice to it
Day 2, I was able to specify Isolated, Routed or direct networking
Day 3, Provision networking features such as Firewall, DHCP
Day 4, Handle repeat VMs, power on vApps after creation, an option wait flag so I would know when the whole process was complete, an easy to modify table of templates linked to hash flags for easy expandability, code clean up with some helper functions

In essence, it worked beyond my wildest expectations.

Here is a sample output of the usage screen and a run time of the script:

Usage:
$ deployrepro -o Org -v vApp --win7 --win2k3 --win2k8 --vsa --ad --sql --vc50 --vc50u1 --vc41u2 --lan

[vApp]
-o|--org  <orgname>     [req] Name of Organization for vApp placement
-v|--vapp <vAppName>    [req] Name of the vApp to create
-p|--on                       Power on vApp after it is created
-w|--wait                     Script will wait for running operations to complete before exiting

[Vms]
--win7=     <OptionalName> add Windows 7 template to vApp
--win2k3=   <OptionalName> add Windows 2003 template to vApp
--win2k8=   <OptionalName> add Windows 2008 R2 template to vApp
--vsa=      <OptionalName> Add VSA storage template to vApp
--ad=       <OptionalName> Add Active directory template to vApp
--sql=      <OptionalName> Add SQL 2008 template to vApp
--vc50 --vc50u1 --vc41u2 Add Virtual Center template to vApp
--tools=    <OptionalName> Add the Tools VM template to vApp
--rhel=     <OptionalName> Add Red hat 6.2 template to vApp
--centos=   <OptionalName> Add CentOS 6.2 template to vApp
--ubuntu=   <OptionalName> Add Ubuntu 12.04 template to vApp
[Networks]
--lan       Add vApp network of the default 192.168.2.x range to vApp
--landirect Add vApp network of the default 192.168.2.x range connected to the Org direct
--direct    Add direct Org network connection
--dhcp      Enable DHCP server
--firewall  Enable Firewall

phil@somehost:~$ deployrepro -o SomeOrg -v "pspencer example" --win7 --rhel --landirect -w -p
deployrepro 0.3 by Phil Spencer
vApp Compose initiated
Waiting for vApp compose to finish...
vApp power on initiated
Waiting for the vApp power on to finish...
Operation completed

I have also made some other helper apps such as lsorg, lscatalog, lsvapps to ease some of the repetitiveness of the day. If you use a vCloud environment make sure you take the time to explore the API it is well worth it. In the above scripts I was using the PHP SDK, there is also a Java and C# SDK available and you can also work with the REST API directly if you so choose to do so.

Check it out.

 

 


Doomsday development resumes

June 3, 2012


It seems I only work on this thing in the summer doesn’t it? Anyways, the last DDAY overhaul brought forth the longest continuous run of Doomsday ever, from August until New years the game was always populated.

I’d like to see if we can break that record so I am going to try and address a long running issue that has always plagued the game. In the first several days you play, unless you are very aggressive there is generally nothing to do other than research and explore. The fun doesn’t start until a few days in and many aren’t patient enough for that. This needs to be addressed.

Lets get to the game plan

Planned changes for next version of Doomsday:

  • Daily quests:  These quests would be automatically generated once a day and would require the player to navigate a sort of dungeon with traps to somehow find the ending. The ending would contain a reward of some kind, either basic cash, scientists, units or land and also rare research items not possible to acquire through the research tree
  • Random map generator: To generate the maps for the quests, the randomness means there would never be a repeat in game play
  • north, south, east, west, fight commands, lets party like it’s the 80’s!
  • PvP inside the dungeon, you may encounter other players (the fight command will be used here) kill them to knock them out of the quest! (limited to 1 quest attempt per hk)
  • Attack and defense levels inside the dungeon based on research levels of your nation

We’ll see if this has any impact on player retention, it will add another interesting layer to the game. I already wrote the map generator this weekend, an ascii rendered output can be viewed here: http://philtopia.com/~spencep/showmap.php

# is path, S start, E End, * trap, . nothing

 


OpenParsec Weekly update 3

February 10, 2012


Well for the third installment of updates I am afraid there are no real code updates, I took the week off as I needed a break. There is still however some great news relating to Parsec despite my lack of feature updates.

Jason W has made some progress with the SDL remake, he gets a game window, with some graphical issues but it is running. Also Jason got an e-mail from one of the original developers of the game and was given Admin access to the original Sourceforge page. This means we now have a better chance at getting attention driven back towards Parsec. The admin access to the SF page also gives us the added bonus of being able to edit and add news to the parsec.org website which is where anyone feeling nostaglic would potentially end up first.

Jason also gave me developer access to the SF repository so I have committed all of my client/server changes into it so they now come from the same source tree. This is great news because before I was working out of a seperate codebase on my 2 dev boxes and a 3rd one for just the server, eeeeek. But that’s all tidied up now.

So this was still a week of progress and the new Parsec Era draws ever so close.


OpenParsec weekly update 2

February 3, 2012


Changes:

  • Got homing missiles functioning correctly server side
  • Fixed an issue client side to allow homing missiles to properly animate towards their targets
  • Created a new RE_CREATEMINE event client side to handle mines since the EXTRA event is not allowed from clients
  • Created handler server side for the RE_CREATEMINE
  • Fixed bug where the mines detonated on drop
  • Fixed bug where the client would not clean up its own mines upon detonation that was leaving ghost mines behind
  • Fixed issue where chat always displayed local players name and not the name of the sender (turned out to be a huge PITA)
  • Removed net.server command in favour of connect command
  • Removed net.server menu item
  • Made Connect button connect to spenced.com server as it is the only existing server at the moment
  • Defaulted console mode to talk, all console commands require / now but talking does not require say

Known Criticals:

  • If your client is laggy and requires a state sync the server or client may close with an ASSERTion
  • Sometimes Mines may cause a client crash, has only happened a couple times

Binaries are up to date with latest changes get them here: Linux and Mac if you need the game data it is here

Another busy week of changes, almost all the items you are given by default on connect now work, the only thing left is the EMP which I will investigate next week. After I get that working I will look into the extra powerups such as the helix cannon or swarm missiles. Jason is continuing his work on a new SDL based client but it is still in the very early stages.



OpenParsec weekly update

January 27, 2012


Changes:

  • Tidied up the menus to a single 4 menu screen
  • Removed Demo/p2p listing in side list, replaced with net.server syntax
  • Mac client now uses pre packaged libs for ease of use
  • Server now properly handles dumb fire missiles
  • Client can now handle Remote events from server for the dumb fire missiles
  • Server side collision model for dumb fire missiles implemented
  • Split binaries/data into separate files parsecdata.zip, parsec-mac-bin.zip, parsec-linux-bin.zip for easier download updates
  • Fixed bug with Missile collision system and now dumb fire and homing missiles can do damage
  • Fixed issue with laser upgrades where the server wasn’t recognizing the upgrade resulting in damage to other players always remaining level 0, now upgrade 1 and 2 work correctly
  • Fixed issue with repair and energy boost not giving amount defined in server configuration

Known Criticals:

These issues have cropped up during play testing the client/server

  • Remote clients dropping mines may abort, This is due to the client trying to execute a ship killed event when the server does not recognize mines so the death is invalid
  • Firewalled users filtering UDP that interferes with Parsec may cause a rapid reconnect/disconnect event and the server aborts
  • Invulnerability power up becomes permanent, the invulnerability power up has been disabled until corrected

It was a pretty successful week so far, it is starting to become a lot of fun, there was a 5 player battle mid week to test out the dumbfire rocket collisions. Currently the servers player limit is set to 16 I would like to try and max that out at some point.

Jason W who made some of the original changes in 2004 has started working on the windows build. From my understanding he became horribly frustrated and may be working on creating an SDL user layer which would benefit and improve all 3 platforms. I will continue implementing the server one piece at a time and if you want to check in and have a fight feel free to download the files just keep in mind the mac client is exceptionally limited at the moment, linux however seems able to do fullscreen, mouse input and is generally more stable.

If you decide to try it out the server is 212.13.194.182 This address will be changing hopefully very soon, the server just grabs the first IP (fixme) on startup currently, this one will be going away. I’ll update this post if it happens before next weeks update.

Stay tuned