Hi,
Does anybody have any sample code on how to unzip using VCO? I found a very promising blog post at might-virtualization, however the example is now missing.
Sorry
I Look for my saved Code and will provide
Andreas Diemer
Senior Consultant
adiemer@vmware.com<mailto:adiemer@vmware.com>
+49 152 09359277 Mobile
+49 89 3706 17161 Office
+49 6325 988038 Fax
VMware Global, Inc. | Zweigniederlassung Deutschland | Freisinger Str. 3, 85716 Unterschleißheim
Sitz: Unterschleißheim | Amtsgericht München HRB 149743 | Geschäftsführer: Joanne Holloway, Tom Jurewicz
Amtsgericht Muenchen HRB 149743 | Geschaeftsfuehrer: Joanne Holloway, Tom Jurewicz
Hinweis:
Diese E-Mail, einschließlich sämtlicher mit Ihr übertragener Dateien, ist vertraulich und für die ausschließliche Verwendung durch die Person oder das Unternehmen vorgesehen, an die/das sie adressiert ist.
Sollten Sie diese E-Mail fälschlicherweise erhalten haben, benachrichtigen Sie bitte den Systemverwalter.
Disclaimer:
This email message is for the sole use of the intended recipient and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
Am 26.07.2012 um 22:00 schrieb LVSCLOUD <communities-emailer@vmware.com<mailto:communities-emailer@vmware.com>>:
VMware Communities<http://communities.vmware.com/index.jspa>
Unzip using VCO
created by LVSCLOUD<http://communities.vmware.com/people/LVSCLOUD> in Orchestrator - View the full discussion<http://communities.vmware.com/message/2083954#2083954
Hi Andreas,
Did you manage to find this code?
Wouldn't it be easier to use a command line tool that unzips files, then use the "command" object in vco to call that tool with the name of the archive to be unzipped and any other command line switches??
That would probably work, but I want to keep my VCO appliance as close to pristine as possible. Do you have any documentation as to what files are overwritten during an automated update of a VCO appliance? If I could be sure that no other packages would be removed, it would not be an issue to tackle this problem in this manner.
Could the vix plugin which is a fling on labs.vmware.com be useful in your case but transferring the file over the the guestvm and running a suitable script or command there also via the vix workflow . Apologies if I misunderstood your query
Thanks for the idea Michael, but the idea is to upload am OVA file via a WAvemaker web portalm have the VCO server unzip it and feed it into the upload an ovf workflow for vCloud Director. I could be making this whole thing over-Complex, so please tell me if you think so.
Hi!
In that situation: Where is your Wavemaker frontend running?
Maybe it was another idea to let the frontend to the unzipping, and give the unzipped ova data to the workflow...
http://dev.wavemaker.com/forums/?q=node/8628
Cheers,
Joerg
Unfortunately, my Java knowledge is nearly nill, and while actively developing, I do not have time to learn. When I saw the blog post with unzipping in VCO itself, I thought my issue was solved.
The standard vix worflows listed when i installed the plugin seem to operate on files, folders on guest vm's with only 1 workflow to copy a file from vCO server to a guest but I'm just scratching the surface of vCO so wouldn't be the best to advise you, hope more knowledgeable members can help you out.
Unfortunately nothing the VIX plugin can do for me will help.
I have been able to peacemeal together SOME code, and can successfully call the zip java class, but am unable to call the java.io.file class as there is already a file class being handled by VCO.
From vco, what would be the best method to create a file, and write to the file from a java stream?
below is my current code
I currently fail on "destinationFilePath = new java.io.File(zipPath,entry.getName());" with "TypeError: [JavaPackage java.io.File] is not a function, it is org.mozilla.javascript.NativeJavaPackage."
/** STEP 1 : Create directory with the name of the zip file** For e.g. if we are going to extract c:/demo.zip create c:/demo* directory where we can extract all the zip entries**/var length = strZipFile.lengthvar fSourceZip = new File(strZipFile);var zipPath = strZipFile.substr(0, length-4);var temp = new File(zipPath);temp.createDirectory();System.log(zipPath + " created");/** STEP 2 : Extract entries while creating required* sub-directories**/var zipFile = java.util.zip.ZipFile(strZipFile);System.log("Called zip java class")var e = zipFile.entries();while(e.hasMoreElements()){var entry = e.nextElement();destinationFilePath = new java.io.File(zipPath,entry.getName());//create directories if required.destinationFilePath.getParentFile().mkdirs();//if the entry is directory, leave it. Otherwise extract it.if(entry.isDirectory()){continue;}else{System.log("Extracting " + destinationFilePath);/** Get the InputStream for current entry* of the zip file using** InputStream getInputStream(Entry entry) method.*/var stream = zipFile.getInputStream(entry)System.log("Retrieved Stream")var CHUCK_LEN = 5 * 1024 * 1024;var b;var buffer/** read the current entry from the zip file, extract it* and write the extracted file.*/fos = new java.io.FileOutputStream(destinationFilePath);bos = new java.io.BufferedOutputStream(fos,1024);while ((b = bis.read(buffer, 0, 1024)) != -1) {bos.write(buffer, 0, b);}//flush the output stream and close it.bos.flush();bos.close();//close the input stream.bis.close();}}
Not sure if this is going to help you but the VMware Lifecycle Manager Application has a plug-in with the scripting objects to unzip. (zipreader) The issue is of course that LCM has is EOL and I am not sure it can be found anywhere.
This was added to LCM because it was missing in vCO (Back then it was a quick fix for the LCM team to add it instead of requesting a feature in vCO and wait for the next release).
I can talk with the VCO product manager about bringing this feature in vCO but it will not help you as the next vCO release has been frozen.
Christophe.
Thanks Christophe,
It would be great if you could put that feature request in for me.
In the mean time, Would you be able to reach out internally to see if anybody else has had to come up with a work-around?
I have located LCM vmoapp files here: https://my.vmware.com/web/vmware/details?productId=32&downloadGroup=VLCM120
The problem is I do not know how you can get a license number for it. If it is still possible to get one (i.e eval license) here is the process:
[if you could not source a LCM license the plug-in will not be installed when restarting the server]
Next week I will be at VMworld and will discuss the inclusion of this feature in the next next vCO release with the product Manager.