chef / knife-vrealize

Plugin for Chef's knife tool to interact with VMware vRealize products
Apache License 2.0
13 stars 13 forks source link

Delete doesn't work? #33

Closed jjasghar closed 5 years ago

jjasghar commented 7 years ago

Platform Details

~/repo/vmware_playground on master± knife vra server delete c38922dd-1e60-44fd-a66a-c960bf755f51
Server ID: c38922dd-1e60-44fd-a66a-c960bf755f51
Server Name: vra01
Waiting For vRA to collect the IPWaiting For vRA to collect the IPIP Addresses: 10.0.0.155
Status: ACTIVE
Owner IDs: vraadmin@vsphere.local
Owner Names: vraadmin admin

Do you really want to delete this server? (Y/N) Y
ERROR: Vra::Exception::NotFound: No destroy action found for resource c38922dd-1e60-44fd-a66a-c960bf755f51

If I can get someone to verify this also in the wild that will help me prioritize this.

jjasghar commented 7 years ago

it looks like they moved the Destroy option in the API for 7.3.

 "hasChildren"=>false,
 "operations"=>[],
 "forms"=>
  {"catalogResourceInfoHidden"=>true,
   "details"=>{"type"=>"extension", "extensionId"=>"csp.places.iaas.item.details", "extensionPointId"=>nil}},
 "resourceData"=>
  {"entries"=>
    [{"key"=>"MachineGuestOperatingSystem", "value"=>nil},
     {"key"=>"MachineMemory", "value"=>{"type"=>"integer", "value"=>4024}},
     {"key"=>"DISK_VOLUMES",
      "value"=>
       {"type"=>"multiple",
        "elementTypeId"=>"COMPLEX",
        "items"=>
         [{"type"=>"complex",
           "componentTypeId"=>"com.vmware.csp.component.iaas.proxy.provider",
           "componentId"=>nil,
           "classId"=>"dynamicops.api.model.DiskInputModel",
           "typeFilter"=>nil,
           "values"=>
            {"entries"=>
              [{"key"=>"DISK_INPUT_ID", "value"=>{"type"=>"string", "value"=>"DISK_INPUT_ID1"}},
               {"key"=>"DISK_CAPACITY", "value"=>{"type"=>"integer", "value"=>40}},
               {"key"=>"DISK_LABEL", "value"=>{"type"=>"string", "value"=>"Hard disk 1"}}]}}]}},
     {"key"=>"MachineBlueprintName", "value"=>{"type"=>"string", "value"=>"Ubuntu 1604 Base"}},
     {"key"=>"Suspend", "value"=>{"type"=>"boolean", "value"=>true}},
     {"key"=>"MachineInterfaceType", "value"=>{"type"=>"string", "value"=>"vSphere"}},
     {"key"=>"MachineCPU", "value"=>{"type"=>"integer", "value"=>2}},
     {"key"=>"MachineExpirationDate", "value"=>nil},
     {"key"=>"PowerOff", "value"=>{"type"=>"boolean", "value"=>true}},
     {"key"=>"ConnectViaNativeVmrc", "value"=>{"type"=>"boolean", "value"=>true}},
     {"key"=>"IS_COMPONENT_MACHINE", "value"=>{"type"=>"boolean", "value"=>false}},
     {"key"=>"ChangeLease", "value"=>{"type"=>"boolean", "value"=>true}},
     {"key"=>"endpointExternalReferenceId", "value"=>{"type"=>"string", "value"=>"d752e70b-f963-4f9a-9927-ee0ecfba6895"}},
     {"key"=>"MachineInterfaceDisplayName", "value"=>{"type"=>"string", "value"=>"vSphere (vCenter)"}},
     {"key"=>"VirtualMachine.Admin.UUID", "value"=>{"type"=>"string", "value"=>"502c7a99-928d-8194-a1e3-343771a027e3"}},
     {"key"=>"Destroy", "value"=>{"type"=>"boolean", "value"=>true}},
     {"key"=>"MachineReservationName", "value"=>{"type"=>"string", "value"=>"vCenter"}},
     {"key"=>"NETWORK_LIST",

It used to be under operations but as you can see it's not there anymore.

https://github.com/chef-partners/vmware-vra-gem/blob/master/lib/vra/resource.rb#L190-L212

dheerajd-msys commented 5 years ago

@jjasghar You may want to close this if https://github.com/chef-partners/vmware-vra-gem/pull/57 fixes this issue?