Giter Club home page Giter Club logo

Comments (4)

bhoriuchi avatar bhoriuchi commented on June 20, 2024

What version of vsphere-connect are you using?

You probably need to define a device type. See this issue #12

from vsphere-connect.

s0j0hn avatar s0j0hn commented on June 20, 2024

I am using v1 of vsphere-connect. Btw this works:

'ReconfigVM_Task',
            {
              _this: util.moRef('VirtualMachine', virtualMachine.moref),
              spec: {
                deviceChange: {
                  device: {
                    key: dbVirtualDisk.key,
                  },
                  operation: 'remove',
                },
              },
            },```

from vsphere-connect.

s0j0hn avatar s0j0hn commented on June 20, 2024

If anyone could tell me how such request should look like from object point of view. That's would be great. TRying to do all actions on vm to add/edit/remove a disk

from vsphere-connect.

jfraudeau avatar jfraudeau commented on June 20, 2024

After some investigation this seems to work

client.method('ReconfigVM_Task',
      {
        _this: moref,
        spec: {
          deviceChange: [{
            device: {
              attributes: { 'xsi:type': 'VirtualDisk' },
              key: device.key,
              capacityInKB: newCapacity,
              unitNumber: device.unitNumber,
              controllerKey: device.controllerKey,
              backing: {
                attributes: { 'xsi:type': 'VirtualDiskFlatVer2BackingInfo' },
                fileName: device.backing.fileName,
                diskMode: device.backing.diskMode,
              },
            },
            operation: 'edit',
          }],
        },
      })

where device is the retrieved disk device.

What remains unsolved is how to automatically retrieve the xsi:type for the original device and its backing since they aren't conveyed in the js representation of the original soap response.

from vsphere-connect.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.