vCD API - how to call updateDisks to resize the disks of a virtual machine?

Had to think about where to post this question; vCD forums or here. I chose here because it's the API specific vCO for vCD and not versions of Java/.NET working team of vCD.

I'm going to build a workflow to allow my team to change the size of a disk. This disk is part of a virtual machine that vCloud Director 'property '. I heard several times to not only change the size of the disk in vCenter as then vCD runs a risk of being confused. I have reviewed the vCO API for the vCD and found that the VclVM object contains the set of disks (VclVM.disks) as a property. This returns an array of VclVirtualDisk. There is a method VclVM.updateDisks (VclVirtualDisk []), which seems to do exactly what I want. Update disk sizes (could be used to add new facilities). I have a bit of a problem to find how to call it from my point of departure.

// selectedDisk: a string selected by the user
// selectedDiskSize: a number input by the user

var disks = virtualMachine.disks;

for (var i = 0; i < disks.length; i++)
{

     if (selectedDisk == disks[i].itemResource.elementName.value)
     {
          if (selectedDiskSize <= disks[i].hardDiskSize)
          {
               throw "New disk size (" + selectedDiskSize + ") must be larger than original disk size (" +
                    disks[i].hardDiskSize + ")";
          }
 
          disks[i].hardDiskSize = selectedDiskSize;
     }
}
 
virtualMachine.updateDisks(disks);


'HardDiskSize' the call throws an error. It is a property read-only and is not a method. The API documentation don't do a good job to define all the methods where I can build a new VclVirtualDisk object. or clone an existing one.

My thought was to update the existing structures of the disc and then pass them to the updateDisks (...) method. Yes, change an internal structure of an object from the outside is not something I should be doing.

Any suggestions on how to "clone" this VclVirtualDisk object to change?

If someone of the vCD of the vCO API team is looking, even updateDisks (...) method will do what I want? Or I have to watch fall down to Java to achieve?


Thank you!

If I remember correctly the ability to change the size of an existing drive is not available in API vCD 1.01.

Christophe.

Tags: VMware

Similar Questions

  • cannot resize the disk on a virtual machine

    Hello!

    I have a little problem, I can not resize the size of the disk on some of my virtual machines.

    I tried yesterday on two and worked well, tried to day (different vm) and it does not work so well for me.

    I first stop the virtual machine, rightklick, change the size to 20 GB, 4 GB and press OK.

    When I then rightklick on the virtual machine after pushing OK the size is always 4 GB (I don't mean in VI client for Windows).

    Why? workaround solution?

    Thnx for help.

    VM there snapshots?

    ---

    VMware vExpert 2009

    http://blog.vadmin.ru

  • How to resize hard disks of a virtual machine?

    Here's the scenario, we virtualized just a physical machine.

    The (c) is 20 GB, and (d) is 190 GB.  We had to maintain these sizes during the P2V, then re-run the P2V and resizing is not an option (the physical machine is in production and should maintain the current States of its disk).

    From what I can tell, these two (c) and (d) are on a virtual disk (vmdk), which is to ~ 210 GB in size.

    Now that we have virtualized, I could clean the disks and delete unnecessary data.  Now I need to change the (c) for 30 GB and I need to change the (d) to be 50 GB

    Can someone please advice of office?  How to cultivate the (c) and shrink (d) while they are both on a virtual disk (vmdk)?

    In which case it is important, we use a SAN with the left hand.  Our esx-data store is 1 TB, with plenty of room.

    Thanks in advance,

    Chris

    Highlight the host you want to convert to (could be the cluster), then right click and select "import machine".  It will then launch converter.  You can do it on by selecting 'Powered on machine' or if feed you first, you can import it as a virtual one by specifying the host / virtual center.

  • Resize the size of the disk on a virtual machine

    Hi all

    I have a virtual machine with 200 GB, would reduce the size of the drive for 100 GB?

    OS: Linux CentOS

    VMWARE ESX4.0

    VMware vCenter Converter Standalone 4.3 can be used to resize Windows and Linux powered sources.

    Although CentOS is not officially supported as source for Converter 4.3, RHEL 2, 3, 4 and 5 are so you could work with CentOS as well. No promises though, as it has not been tested and officially not certified.

    See page 52 of the Converter 4.3 Admin Guide at http://www.vmware.com/pdf/convsa_43_guide.pdf for more information.

  • How to make a visible USB hard disk for a virtual machine on ESXI 4.1?

    Hi all

    As I am new to the world of vmware ESXI, I always make mistakes or I don't undertand all therefore be complete :-).

    So I have a HP Proliant ML 350 G6 Server installed with ESXI 4.1 and I want to connect a USB hard disk to a virtual machine (SBS 2K 8). Currently, the virtual machine is not able to see the hard drive.

    I already add a USB controller to the virtual machine, but my USB HARD drive is still not visible to my virtual machine.

    Can you help on that?

    Thank you

    Michael

    Next, add a USB device to the virtual computer (in the change settings tab), there are different things, USB controller and USB devices. Sometimes, you may have to restart the virtual machine.

    Greetings

  • How to call a method of the AM with parameters of Bean managed?

    Hello world

    I have a situation where I need to call the Managed bean (setDefaultSubInv) AM, under value changes Listner method. Here's what I do, I added the AM method on page links, and then at the bean call it

    Class [] paramTypes = {};
    Object [] params = {};
    invokeEL ("#{bindings.setDefaultSubInv.execute}", paramTypes, params);

    It works and be able to call this method, if there are no parameters. Say that I pass a parameter to setDefaultSubInv(String a) method AM, I tried to call it bean but raise an error

    The string available = 'test ';
    Class [] paramTypes = {String.class};
    Object [] params = {DISP};
    invokeEL ("#{bindings.setDefaultSubInv.execute}", paramTypes, params);

    I'm not sure this is the right way to call the method with parameters. Can anyone tell how to call a method of the AM with bean to manage settings

    Thank you
    San.

    Just do the following

    1. your method in the Client Interface.
    2 - Add to Page Def.
    3 - Customize your Script like below one to reach your goal.

    BindingContainer links = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("GetUserRoles");
    operationBinding.getParamsMap () .put ("username", "oracle");
    operationBinding.getParamsMap () .put ("role", "F1211");
    operationBinding.getParamsMap () .put ("Connection", "JDBC");
    Object result = operationBinding.execute ();
    If (! operationBinding.getErrors () .isEmpty ()) {}
    Returns a null value.
    }
    Returns a null value.
    }

    I hope it helps you
    Thank you

  • How to call a method of the Module of the Application of a class of ViewObjectImpl?

    Howdy,

    With the help of Studio Edition Version 11.1.1.3.0.

    I have a setup where a user between an element and a price. When the item and the price is committed, I want this event to then influence the price of his parents. My idea is to do a ViewRowImpl class and then call an AppModuleImpl class that is her parents and it affects their attributes.

    Question:

    (1) how to call a method on the Module of the Application of a class of ViewObjectImpl?
      public void setPrice(Number value)
      {
        setAttributeInternal(PRICE, value);
        
        DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
        BindingContext bctx = bindings.getBindingContext();
        DCDataControl control = bctx.findDataControl("AppModuleDataControl");
        ApplicationModule am = (ApplicationModule ) control.getDataProvider();
        //uh now what??
        // am.getProperty("method call(getTipsNum())") ?
      }
    (2) when I set an attribute on a view through the AppModuleImpl object, I'll make an infinite loop in this way? that is the AppModuleImpl calls the ViewRowImpl class on a setAttribue (< name >, < value >)?

    Thank you guys.

    It's an interesting problem, I'll take a stab to solve here.

    First let's see I understand the data model:

    (a) there is a table called BOM with a self referencing FK creating a hierarchy of data
    (b) each record BOM is usually a child to another record BOM, so using your example, a van is composed of frames and tires - Let's say that this amounts to 3 records in the Schedule table.
    (c) check parent, truck, is the root of the hierarchy, and so the FK relationship sucks.
    (d) the price of a truck consists of its children. So if the frame costs $1,000 and tires $500, the pickup truck costs total $1,500.
    (e) a change in the price of any folder BOM, upwards or downwards must be propagated to its parent folder BOM. As an example, if the tires up to $600, the pickup truck is now $1600 ($1000 frame + tires $600).

    Does this sound right?

    Well, that I understand the data model, here's what I'd do build in what concerns objects ADF BC:

    (1) an entity BOM (EO) object - let's call this Bom
    (2) a BOM BOM EO association (representing the self referencing FK)-Let's call it BomBomFkAssoc
    (3) an object to view BOM (VO) based on the EO - let's call it BomView
    (4) BOM VO view link BOM VO based on EO of #2 association - call BomBomFkLink

    Next, we create the Java constructs:

    (5) #1 ensures that the EntityImpl has been created
    (6) #4 guarantees for the EO association that it generates the required Java accessors

    Now the additional code:

    (7) for the EntityImpl # 5, in the field of setter setPrice() something like the following:

    public Number setPrice(Number value) {
      Number diffPrice = value.minus(getPrice()); 
    
      setAttributeInternal(PRICE, value);
    
      BomImpl parentBom = getBom(); // from step #6, the EntityImpl should have an accessor method to it's parent BomImpl record
      Number parentDiffPrice = parentBom.getPrice().add(diffPrice);
      parentBom.setPrice(parentDiffPrice);
    }
    

    From a point of view JSF, now when I change a specific record of the Nomenclature in an edit form, a change for the price of registration for the Bill to submit time will automatically propagated to the top of the hierarchy of the BOM because the method setPrice() of the current OS of BOM will walk to the top of the hierarchy of the BOM to the parent following the call it is setPrice() method , which will be then walk to the next BOM record and so forth. At the time all BOM records with changes should be committed to the database.

    You don't need to test this in JSF, but simply the browser component of company on the Application template project Module.

    .... Of course... If I misunderstood your data model, it will be of no help whatsoever.

    CM.

  • If time machine is incremental how it removes previous versions when the disk is full, without breaking the chain, so do not be able to restore all changes since the first full file

    If time machine is incremental how it removes previous versions when the disk is full, without breaking the chain, so do not be able to restore the file with any changes made since the full backup first file...

    If the TM drive storage is full TM automatically deletes the version the oldest files for the new incremental backups can be made. Thus, in this case you cannot restore the versions that TM deleted because it takes more storage.

  • How to enable 3D Graphics and HD audio on a virtual machine?

    How to enable 3D Graphics and HD audio on a virtual machine?

    The 3D support is supposed to allow the possibility for the graphical interface of Windows Aero, in order to test with a Windows 7 if possible.

  • How to use an iso of media store in a virtual machine?

    I know this is a stupid question, but I can't understand how to use an iso of media store in a virtual machine in a laboratory Manager configuration. I copied on an ISO in my store of media NFS and its all synced to the top and available to use. But what I want to know is, is there a way we can map the iso in a virtual machine in the config of lab manager and make it look like cd?

    Pls advice.

    just a couple first checks:

    1. the ISO standard appear in the media section of the organization who needs to use it.

    2. the NFS store is accessible by all esx hosts used in this organization

    3. go to the page of the console for the virtual machine that needs to use it.

    4 right-click the VM name to get the full menu

    5. Insert the CD

    6. choose the ISO from the menu drop down.

    All this is in the user manual.

    Kind regards

    Jon Hemming, b.SC., RHCT, VMware vExpert 2009
    http://Twitter.com/vJonHemming

    If your question or problem has been resolved, please click the "right answer".  If someone helped him, please click "useful answer.

  • How to configure the CD driver on the host for a virtual machine?

    After you create a virture machine and put the CD of driver on host, when powered on the vertual machine, may not start the drive form the CD only from NIC.

    How to configure the CD driver on the host for a virtual machine?

    Right-click on the virtual computer and go to edit settings. Click the Options tab and under the tip list, there should be Boot Options. Enter an amount of milliseconds to wait before your boot, so you can activate the CD-ROM. You can also activate the CD even if it boots to the NETWORK card option, and then reset the virtual machine. Get the focus of this virtual machine on the console session, and then press ctrl-alt-insert. Your CD-ROM will stay connected if you do not want to delay the startup process.

  • Cannot resize the disk of the asm

    Hi, greetings of the day...

    I have created a disk of asm using asmtool as:
    asmtool - create 500 D:\Asm_disks\disk3;
    asmtool - create 500 D:\Asm_disks\disk4;
    Now when I try to resize the disk,



    SQL > select name, total_mb v$ asm_disk;

    NAME TOTAL_MB
    ------------------------------ ----------
    DATA_0000 2000
    DATA_0001 2000
    FRA_0002 3000
    FRA_0003 3000
    DATA_0002 500
    DATA_0003 500

    6 selected lines.

    SQL > alter diskgroup DATA resize disk size 'DATA_0002' 1000M;
    change DATA diskgroup resize disk size 'DATA_0002' 1000M
    *
    ERROR on line 1:
    ORA-15032: not all changes made
    ORA-15289: ASM DATA_0002 disk cannot be resized beyond 500 M



    Please help me in this regard

    Thank you
    Uday

    udayjampani wrote:
    Thank you

    I understand what you say, I have created a disk of asm with 500 MB of size using asmtool, so I can't resize using asm instance.

    1. What is the use of asmtool-added option, we can add an existing using this command drive space?

    This isn't for adding space, but it adds the label to the disk partition...
    asmtool - add \Device\Harddisk1\Partition1 ORCLDISKASM0
    >

    2 can you please explain this more, * it could be increased if you already held 300 total asm 500 disk space *?

    Think like OS, you have created a 10 GB partition for disk D:\ example. And now, you create files/folders with size of hugh (as some movies ;)) to drive D:\, so eventually your drive D:\ will fill. This is the case even with your asm disk, once you have used all your available space of the asm disk (that you created through asmtoll), you can not increase.
    By asmtool - create D:\Asm_disks\disk3 500, you assign the total size to 300 from the asm disk. Just as you add 10 GB partition for OS...

    You come to the backup from my point of view: it could be increased if you already worked 300 asm disk space total 500

    I have created the disk with the following text:
    asmtool - create 500 D:\Asm_disks\disk3 > size is 500

    I create diskgroup with
    SQL > create diskgroup DB 'D:\Asm_disks\disk3' size disc 300; > Here I wll use only max 300 size of 500 total. So once I get to the threshold of 300, I can increase the asm disk up to 500.
    As
    SQL > alter diskgroup DB resizing disk "D:\Asm_disks\disk3' size 500; > Increasing up to 500

    Default if the clause you SIZE omit while creating a diskgroup, asm then disc occupies all the available space of the device that you have created by asmtool

    >

    3. What is meant occupation here, not here where we can control the right of occupancy?

    We can control as I explained.

    See also article that explains: http://www.oracle-base.com/articles/10g/AutomaticStorageManagement10g.php
    Hope that explains

  • How can I transfer a file from the operating system to a backup of the production running VM virtual machine?

    Problem:  After I do a backup one using ghettoVCB on a local VMFS volume, I have a virtual machine that I can start something happened to that running.  However, sometimes I just need a file from the OS level, which means that I would need to start to get them, but then I have an IP address conflict.  I can't imagine a way to have the NICs turned off and still be able to move the file.  If I change the IP addresses, the software that I need to create the file that I need to transfer no longer works because, although there no need of constant connectivity to the seller, it is locked to the public IP address.http://communities.vmware.com/images/emoticons/sad.gif

    Material:  I have two 4 ESXi hosts to work, each with local VMFS volumes.  They share a private vlan common and a vlan common public.  They each ssh, ftp, wput, wget, and rsync available.  I have a Windows 2003 Server VM which also hosts a NFS and the VI client and other VMWare tools.  It also has private and public interfaces as do virtual machines that would be to make and receive the OS files.

    Question:  How can I transfer a file from the operating system to a backup of the production running VM virtual machine?

    Thank you!

    Yes Mr President, make sure you set the network on this virtual machine to be connected to the 'Internal' vswitch, you set up before turning the power on to the virtual machine.

    -

  • Performance of the queries of multiple virtual machines in a single call

    Hi all

    I'm a little rusty on what I used to do that, but that was almost a year ago...

    I'm trying to retrieve the performance data for several virtual machines.

    For now, I have this in serial mode, i.e. running QueryPerf on each virtual machine.

    The problem is that I have about 800 of them connected to one of my VC. Needless to say, this take a LOT of time to review all of the VM.

    Y at - it sort of method that will allow me to provide a picture of VM and application (performance counters) on all virtual machines, I guess that this will be faster than going and one by one.

    Thanks in advance!

    Hello

    QueryPerf method accepts an array of data object PerfQuerySpec. Here, each PerfQuerySpec object points to a managed entity for which the statistics are to recover.

    So in your scenario, before calling queryPerf, you can create PerfQuerySpec for each virtual machine, assign to each of them in PerfQuerySpec table. You can then pass this [of PerfQuerySpec] the call of queryPerf to retrieve statistics for all virtual machines.

    Hope that the information above solves your query.

    -Neha

  • SRM API: How to call CreateAbrProtectionGroup using PowerCLI

    Anyone who has used CreateAbrProtectionGroup API to create a new protection group?

    What are the arguments to pass to this method? The API doc says that the arguments include the moref in protection record and the name of the protection group.

    However, I see the error on the specification of these arguments below:

    $pgmoref = $srmApi.Protection.CreateAbrProtectionGroup ("file-group-v22", "Group02")

    Could not find an overload for the 'CreateAbrProtectionGroup' and the number of arguments:

    « 2 ».

    On line: 1 char: 53

    + $pgmoref = $srmApi.Protection.CreateAbrProtectionGroup < < < < (folder "-group-v22")

    "Group02")

    + CategoryInfo: NotSpecified: (:)) [], MethodException)

    + FullyQualifiedErrorId: MethodCountCouldNotFindBest

    According to the API Reference , there are 4 parameters for the CreateAbrProtectionGroup method.


    And I think you will have to provide a MoRef object instead of a string for parameters like MoRef.

    $folder. ExtensionData.MoRef

Maybe you are looking for