VMware Cloud Community
houghtp
Contributor
Contributor
Jump to solution

Extend VMDK

Hi would anyone have a workflow to extend a VMDK, then using VIX extend the partition inside the guest OS?

I know this is fairly straight forward with PowerCLi Set-Harddisk cmdlet but i can't find a way to do it with Orchestrator?

thanks.

0 Kudos
1 Solution

Accepted Solutions
tschoergez
Leadership
Leadership
Jump to solution

Strange. In the scripts there are System.debug...-lines before something interesting happens, so you should see at last some log entries. Can you doublecheck your orchestrator configuration, and e.g. disable the VIX-plugin temporaily?

Can you execute other (built-in for example) workflows?

View solution in original post

0 Kudos
15 Replies
tschoergez
Leadership
Leadership
Jump to solution

Hi!

Hm, in orchestrator its not that easy.

First part: Extend the disk of the VM:

You have to do a reconfigureVM-Task for the VM, and in the configSpec for this task you have to specify a new configuration for the disk you want to extend.

Some code example:

//Set new Disksize

disk.capacityInKB = parseInt( "" + (newSizeGb10241024) );

//Add disk to devicespec and devicespec to configspec

var deviceSpec = new VcVirtualDeviceConfigSpec();

deviceSpec.operation = VcVirtualDeviceConfigSpecOperation.edit;

deviceSpec.device = disk;

var deviceConfigSpecs = new Array();

deviceConfigSpecs.push(deviceSpec);

var configSpec = new VcVirtualMachineConfigSpec();

configSpec.deviceChange = deviceConfigSpecs;

I create a demo-workflow with a full example, you can download it from:

http://www.vcoportal.de/downloads/extendDisk.workflow

second part: Use VIX-API to extend the partition inside the guest:

I have no idea ?:|... But if you find something, I'm looking forward to some examples here ... :).

Cheers,

joerg

0 Kudos
houghtp
Contributor
Contributor
Jump to solution

Hi Joerg, thanks for the reply.

When i run your workflow it errors but doesn't give me an eroor message. In the server.log all i can see is:

2010-10-28 09:08:22.725+0100 WARN Error in execution of workflow 'extendDisk'

java.lang.NoClassDefFoundError: Could not initialize class com.vmware.vmo.plugin.vix.VixServer

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:247)

at ch.dunes.vso.sdk.SDKModuleDescription.defineInScope(SDKModuleDescription.java:453)

at ch.dunes.vso.sdk.ModulesFactory.defineInScope(ModulesFactory.java:409)

at ch.dunes.scripting.jsmodel.Definitions.doDefineModelInScope(Definitions.java:94)

at ch.dunes.scripting.jsmodel.Definitions.defineModelInScope(Definitions.java:48)

at ch.dunes.scripting.server.script.MainScriptingObject.(MainScriptingObject.java:144)

at ch.dunes.workflow.engine.mbean.helper.WorkflowHandler.execute(WorkflowHandler.java:183)

at ch.dunes.workflow.engine.mbean.helper.WorkflowHandler.run(WorkflowHandler.java:155)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

at java.util.concurrent.FutureTask.run(FutureTask.java:138)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

at java.lang.Thread.run(Thread.java:619)

any ideas?

0 Kudos
tschoergez
Leadership
Leadership
Jump to solution

Hm, the error in the logs show some issues with the VIX-Plugin for Orchestrator (I dont have it in my environment).

But I dont think this WARNing has something to do with the workflow, because it does not use the VIX-plugin.

In my scripting-parts I do some logging with System.debug(...), so you should check the scripts-logs.log.

Do you see any error messages in the "logs"-Tab of the Workflow-Token in the vCO-Client?

Cheers,

joerg

0 Kudos
houghtp
Contributor
Contributor
Jump to solution

Yeah I checked in the script-logs.log but there's nothing in there from today (I've ran your workflow several times this morning) .

The Logs tab is also empty...?

0 Kudos
tschoergez
Leadership
Leadership
Jump to solution

Strange. In the scripts there are System.debug...-lines before something interesting happens, so you should see at last some log entries. Can you doublecheck your orchestrator configuration, and e.g. disable the VIX-plugin temporaily?

Can you execute other (built-in for example) workflows?

0 Kudos
houghtp
Contributor
Contributor
Jump to solution

Ok that was it. I removed the VIX plugin and all is working now.

As for the next part i presume i would have to run diskpart to extend the volume in the guest. Do i need to use VIX for that or can I just call a command in the guest from JavaScript?

I see it something like:

Create diskpart script on the fly replacing specific volume number with Disk number entered in presentation layer (subtracting 1 to get correct volume)

copy the script into the guest (presume i would need VIX for this)

executing diskpart /s command pointing to script

remove script from guest.

what do you think, is there a better way?

thanks for your help on this !

0 Kudos
tschoergez
Leadership
Leadership
Jump to solution

To run diskpart, you need do execute an command inside the guest. For this there is no built-in-functionality in vCO.

You can try to use remcom.exe, psexec, or install a SSH-Server in the guest.

With a working VIX-Plugin it would be possible to execute commands via the VIX-API.

I remember there was an example for Perl what does exactly what you want:

http://communities.vmware.com/docs/DOC-11938

Maybe you can get some ideas here.

Cheers,

joerg

0 Kudos
admin
Immortal
Immortal
Jump to solution

Hi,

had the same problem when installing/using the VIX plugin. Everything is shown fine in the vCO GUI but every workflow fails. Think the problem was:

In order for the plug-in to function properly, you must update your system PATH variable by appending a ";” and this path to it. You can add this value to the path variable by editing it under Environment Variables, under your System Properties.

best regards

Christian

houghtp
Contributor
Contributor
Jump to solution

Sorry Christian, when you say appending a ";” and this path to it. which path are you referring to?

0 Kudos
houghtp
Contributor
Contributor
Jump to solution

not to worry, i found it - its in the guide!!

0 Kudos
tschoergez
Leadership
Leadership
Jump to solution

Hi Paul,

I put together another workflow which uses the VIX-Plugin to extend a partition. You can download from

http://www.vcoportal.de/downloads/extendGuestPartition.workflow

It's not perfect, but it works in my lab. Please see the annotations on http://www.vcoportal.de/Downloads.html#Zweig3

When you put both examples together, you have to trigger a disk rescan in windows. I have no idea how to automate this (and its not in the perl example Smiley Happy ).

Cheers,

Joerg

0 Kudos
muralikrishnaP1
Contributor
Contributor
Jump to solution

links not working.....!!!

n plz ths n help me out

http://communities.vmware.com/thread/399711

0 Kudos
tschoergez
Leadership
Leadership
Jump to solution

new link:

http://www.vcoportal.de/downloads/

the last two workflows might help you...

Cheers,

Joerg

0 Kudos
muralikrishnaP1
Contributor
Contributor
Jump to solution

in which software should i open that workflows?? plz help me out na

0 Kudos
tschoergez
Leadership
Leadership
Jump to solution

Well, your post is in the "VMware vCenter Orchestrator" section of the forums (at least this one :smileyplain:), so try it with VMware vCenter Orchestrator...

0 Kudos