Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    J.R. Garcia
    @jrgarcia
    @nilsparmar it looks like your device spec is not correct. Feel free to post the spec you’re using here (or create an issue) to get help.
    nilsparmar
    @nilsparmar
    okay
    vm_cfg = {
    :name => vmname_var ,
    :guestId => 'otherGuest',
    :files => { :vmPathName => '[datastore1]' },
    :numCPUs => 1,
    :memoryMB => 128,
    :deviceChange => [
    {
    :operation => :add,
    :device => VIM.VirtualLsiLogicController(
    :key => 1000,
    :busNumber => 0,
    :sharedBus => :noSharing
    )
    }, {
    :operation => :add,
    :fileOperation => :create,
    :device => VIM.VirtualDisk(
    :key => 0,
    :backing => VIM.VirtualDiskFlatVer2BackingInfo(
    :fileName => '[datastore1]',
    :diskMode => :persistent,
    :thinProvisioned => true
    ),
    :controllerKey => 1000,
    :unitNumber => 0,
    :capacityInKB => 400000
    )
    }, {
    :operation => :add,
    :device => VIM.VirtualE1000(
    :key => 0,
    :deviceInfo => {
    :label => 'Network Adapter 1',
    :summary => 'VM Network'
    },
    :backing => VIM.VirtualEthernetCardNetworkBackingInfo(
    :deviceName => 'VM Network'
    ),
    :addressType => 'generated'
    )
    }
    ],
    :extraConfig => [
    {
    :key => 'bios.bootOrder',
    :value => 'ethernet0'
    }
    ]
    }
    I used the default script but having issue!
    @jrgarcia help in this issue
    Adam Grare
    @agrare
    @nilsparmar the defaults work fine for me, do you actually have a datastore named 'datastore1' ? invalid device 1 would indicate that your disk is the issue there
    nilsparmar
    @nilsparmar
    @agrare yes..I have datastore1.
    Adam Grare
    @agrare
    @nilsparmar try removing devices from your deviceChange array until it succeeds, that will at least narrow it down to a specific device(s) that is causing it
    nilsparmar
    @nilsparmar
    @agrare Its not working
    Adam Grare
    @agrare
    With no devices it doesn't even work?
    And it still says invalid config for device 1?
    nilsparmar
    @nilsparmar
    @agrare I removed device array - it raised below error: /home/calsoft3/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/rbvmomi-2.3.0/lib/rbvmomi/connection.rb:63:in `parse_response': InvalidRequest: (RbVmomi::Fault)
    Required property device is missing from data object of type VirtualDeviceConfigSpec
    Adam Grare
    @agrare
    Try with an empty array instead of removing it completely
    nilsparmar
    @nilsparmar
    agrare okay sir
    when left empty in array: syntax error, unexpected ','
    :key => ,
    2) if set as nil value -> Required property key is missing from data object of type VirtualLsiLogicController
    Required property busNumber is missing from data object of type VirtualLsiLogicController
    Required property sharedBus is missing from data object of type VirtualLsiLogicController
    Adam Grare
    @agrare
    What's your spec look like with it empty?
    nilsparmar
    @nilsparmar
    yes.. if I set as Blank(nil) it gives me error: Required property key is missing from data object of type VirtualLsiLogicController
    Adam Grare
    @agrare
    It sounds like you still have some devices
    nilsparmar
    @nilsparmar
    I don't undertstand.. How it works!
    can you help me?
    Adam Grare
    @agrare
    I'm trying :)
    nilsparmar
    @nilsparmar
    okay . Thanks
    Adam Grare
    @agrare
    vm_cfg = {
      :name => vmname_var ,
      :guestId => 'otherGuest',
      :files => { :vmPathName => '[datastore1]' },
      :numCPUs => 1,
      :memoryMB => 128,
      :deviceChange => [
      ],
      :extraConfig => [
        {
          :key => 'bios.bootOrder',
          :value => 'ethernet0'
        }
      ]
    }
    nilsparmar
    @nilsparmar
    should I remove all the configuration and set as your given information?
    Adam Grare
    @agrare
    so try that and see if you can at least create a "blank" vm
    then we can add in devices 1 at a time and isolate the problem
    nilsparmar
    @nilsparmar
    okay. let me try
    Here is the error:
    wait_for_completion': InvalidState: The operation is not allowed in the current state. (RbVmomi::Fault)
    Adam Grare
    @agrare
    doesn't sound like an issue with your spec then since that is pretty basic (just tried it on my VC and still works fine)
    maybe check the datacenter / hosts you're creating the VM on, e.g. are they all in maintenance mode or something
    nilsparmar
    @nilsparmar
    Thanks for your great help! it works for me. the issue is as you mentioned above - changing the resource pool and it works
    nilsparmar
    @nilsparmar
    @agrare Is there any code to Add New Device as CD/DVD DRIVE for iso deployment to created blank vm?
    phospi
    @phospi
    Hi, i'd like to know if there are any plans to sync vmware tags like it is done with aws tags today. Does someone work on it or should I open a request or has this been denied in the past?
    nilsparmar
    @nilsparmar
    @agrare have you any idea about the configuration of Add New Device as CD/DVD Drive when we create new vm. Using that existing create_vm.rb script?
    Adam Grare
    @agrare
    There's lots of examples of that, try googling for pyvmomi there tend to be more examples
    nilsparmar
    @nilsparmar
    @agrare Thanks for support
    It works fine
    but I using now different vpshere client and it gives me below error:
    CannotAccessVmComponent: A component of the virtual machine is not accessible on the host. (RbVmomi::Fault)
    you have any idea ?
    Adam Grare
    @agrare
    @nilsparmar it doesn't sound like you're having RbVmomi issues, these are general vSphere issues
    Think about "A component of the virtual machine is not accessible on the host. ", sounds like some attribute of the VM isn't available on the host you're creating on, I'd suggest checking the path to the ISO and making sure that host has that datastore mounted for example
    nilsparmar
    @nilsparmar
    @agrare Thanks for the help!
    Aleksey
    @aleksb86
    Who can explain, how to identify main hdd of vm? I found that it always have unitNumber == 1 and key == 2000. How reliable is it?
    Tino Vázquez
    @tinova
    hello! we are experiencing a memory leak, main suspect is a lot of RbVmomi::VIM::PerfCounterInfo
    any hints on what we are missing to destroy, or what are we wrongly keep referenced?
    Brandt Woolf
    @bwoolf1122
    Hey everyone, I am trying to handle PCI and USB passthrough configuration on a VM via rbvmomi. The only piece I cannot determine is how to check wether a device is already assigned to a VM without checking the VM. Does anyone know how to determine the passthrough device VM assignment from the device object?