Convert to VM - Automate Essentials

automate

#1

Hi,

I downloaded the automate essentials automate domain, and I’m trying to leverage covert to VM button. (from template)

When trying to convert the template to a machine this is what I get:

----] I, [2017-09-15T11:16:14.476791 #2890:6d112c] INFO – : <AEMethod [/PitneyBowes/Integration/VMware/vCenter/MarkVMAsVirtualMachine]> Starting [----] I, [2017-09-15T11:16:15.563096 #2890:6cf5c0] INFO – : CloudForms Automate Method Started [----] I, [2017-09-15T11:16:15.564225 #2890:6cf5c0] INFO – : Begin $evm.root.attributes [----] I, [2017-09-15T11:16:15.609472 #2874:6d112c] INFO – : Q-task_id([miq_provision_1000000005950]) Updated namespace [miqaedb:/Infrastructure/VM/Provisioning/StateMachines/Methods/CheckProvisioned#create ManageIQ/Infrastructure/VM/Provisioning/StateMachines] [----] I, [2017-09-15T11:16:15.634854 #2890:d1ad44] INFO – : Attribute: ae_provider_category = infrastructure [----] I, [2017-09-15T11:16:15.641386 #2890:d1ad44] INFO – : Attribute: miq_group = #MiqAeMethodService::MiqAeServiceMiqGroup:0x00000017e18180 [----] I, [2017-09-15T11:16:15.645138 #2890:d1ad44] INFO – : Attribute: miq_server = #MiqAeMethodService::MiqAeServiceMiqServer:0x0000001ad77340 [----] I, [2017-09-15T11:16:15.647627 #2890:d1ad44] INFO – : Attribute: miq_server_id = 1000000000009 [----] I, [2017-09-15T11:16:15.651090 #2890:d1ad44] INFO – : Attribute: object_name = Request [----] I, [2017-09-15T11:16:15.654041 #2890:d1ad44] INFO – : Attribute: request = vmware_MarkVMAsVirtualMachine [----] I, [2017-09-15T11:16:15.657900 #2890:d1ad44] INFO – : Attribute: tenant = #MiqAeMethodService::MiqAeServiceTenant:0x00000017e1a160 [----] I, [2017-09-15T11:16:15.660549 #2890:d1ad44] INFO – : Attribute: user = #MiqAeMethodService::MiqAeServiceUser:0x00000017d94ec0 [----] I, [2017-09-15T11:16:15.662119 #2890:d1ad44] INFO – : Attribute: user_id = 1000000000001 [----] I, [2017-09-15T11:16:15.666604 #2890:d1ad44] INFO – : Attribute: vm = EngageOne3.1.2+Jboss_6.2+Win2012r2+OpenEDMS+SQLServer2012 [----] I, [2017-09-15T11:16:15.668275 #2890:d1ad44] INFO – : Attribute: vm_id = 1000000041286 [----] I, [2017-09-15T11:16:15.669670 #2890:d1ad44] INFO – : Attribute: vmdb_object_type = vm [----] I, [2017-09-15T11:16:15.671283 #2890:6cf5c0] INFO – : End $evm.root.attributes [----] I, [2017-09-15T11:16:15.672211 #2890:6cf5c0] INFO – : [----] I, [2017-09-15T11:16:15.691351 #2890:6cf5c0] INFO – : Detected VM: EngageOne3.1.2+Jboss_6.2+Win2012r2+OpenEDMS+SQLServer2012 vendor: vmware provider: Watford ems_ref: vm-64024 [----] I, [2017-09-15T11:16:15.692233 #2890:6cf5c0] INFO – : Resource Pool Name: Default for Cluster / Deployment Role Watford Cluster [----] I, [2017-09-15T11:16:18.561973 #2874:6d112c] INFO – : Q-task_id([miq_provision_1000000005950]) Updated namespace [Infrastructure/VM/Provisioning/StateMachines/Methods/check_provisioned ManageIQ/Infrastructure/VM/Provisioning/StateMachines] [----] I, [2017-09-15T11:16:18.577716 #2874:6d112c] INFO – : Q-task_id([miq_provision_1000000005950]) Invoking [inline] method [/ManageIQ/Infrastructure/VM/Provisioning/StateMachines/Methods/check_provisioned] with inputs [{}] [----] I, [2017-09-15T11:16:18.581791 #2874:6d112c] INFO – : Q-task_id([miq_provision_1000000005950]) <AEMethod [/ManageIQ/Infrastructure/VM/Provisioning/StateMachines/Methods/check_provisioned]> Starting [----] E, [2017-09-15T11:16:20.525908 #2890:6cf5c0] ERROR – : [(ServerFaultCode) The object has already been deleted or has not been completely created] /opt/rh/cfme-gemset/gems/savon-2.2.0/lib/savon/response.rb:70:in `raise_soap_and_http_errors!’

[----] I, [2017-09-18T12:36:20.876586 #2111:93353c] INFO – : Attribute: miq_server_id = 1000000000013 [----] I, [2017-09-18T12:36:20.879656 #2111:93353c] INFO – : Attribute: object_name = Request [----] I, [2017-09-18T12:36:20.881229 #2111:93353c] INFO – : Attribute: request = vmware_MarkVMAsVirtualMachine [----] I, [2017-09-18T12:36:20.883599 #2111:93353c] INFO – : Attribute: tenant = #MiqAeMethodService::MiqAeServiceTenant:0x00000011180dd8 [----] I, [2017-09-18T12:36:20.886081 #2111:93353c] INFO – : Attribute: user = #MiqAeMethodService::MiqAeServiceUser:0x00000011740cc8 [----] I, [2017-09-18T12:36:20.887590 #2111:93353c] INFO – : Attribute: user_id = 1000000000001 [----] I, [2017-09-18T12:36:20.894266 #2111:93353c] INFO – : Attribute: vm = CentOS 6.6 - GUI [----] I, [2017-09-18T12:36:20.895919 #2111:93353c] INFO – : Attribute: vm_id = 1000000040287 [----] I, [2017-09-18T12:36:20.897426 #2111:93353c] INFO – : Attribute: vmdb_object_type = vm [----] I, [2017-09-18T12:36:20.898943 #2111:4aa344] INFO – : End $evm.root.attributes [----] I, [2017-09-18T12:36:20.899950 #2111:4aa344] INFO – : [----] I, [2017-09-18T12:36:20.933583 #2111:4aa344] INFO – : Detected VM: CentOS 6.6 - GUI vendor: vmware provider: Watford ems_ref: vm-46370 [----] I, [2017-09-18T12:36:22.345276 #2087:4af13c] INFO – : Q-task_id([miq_provision_1000000005958]) Updated namespace [Infrastructure/VM/Provisioning/StateMachines/VMProvision_vm/update_provision_status PitneyBowes/Infrastructure/VM /Provisioning/StateMachines] [----] I, [2017-09-18T12:36:22.675623 #2087:4af13c] INFO – : Q-task_id([miq_provision_1000000005958]) Invoking [inline] method [/PitneyBowes/Infrastructure/VM/Provisioning/StateMachines/VMProvision_VM/update_provision_status] with inpu ts [{}] [----] I, [2017-09-18T12:36:22.677390 #2087:4af13c] INFO – : Q-task_id([miq_provision_1000000005958]) <AEMethod [/PitneyBowes/Infrastructure/VM/Provisioning/StateMachines/VMProvision_VM/update_provision_status]> Starting [----] I, [2017-09-18T12:36:24.704318 #2087:4af13c] INFO – : Q-task_id([miq_provision_1000000005958]) <AEMethod [/PitneyBowes/Infrastructure/VM/Provisioning/StateMachines/VMProvision_VM/update_provision_status]> Ending [----] I, [2017-09-18T12:36:24.704528 #2087:4af13c] INFO – : Q-task_id([miq_provision_1000000005958]) Method exited with rc=MIQ_OK [----] I, [2017-09-18T12:36:24.706159 #2087:4af13c] INFO – : Q-task_id([miq_provision_1000000005958]) Followed Relationship [miqaedb:/Infrastructure/VM/Provisioning/StateMachines/VMProvision_vm/clone_to_vm#create] [----] I, [2017-09-18T12:36:24.707506 #2087:4af13c] INFO – : Q-task_id([miq_provision_1000000005958]) Followed Relationship [miqaedb:/infrastructure/VM/Lifecycle/Provisioning#create] [----] E, [2017-09-18T12:36:27.467770 #2111:4aa344] ERROR – : [(ServerFaultCode) Attribute xsi:nil not allowed on element vim25:pool, which is not nillable.

I ran CF in debug mode and got this:

#client.operations.sort.each { |operation| $evm.log(:info, “Savon Operation: #{operation}”) } # login and set cookie login(client, username, password) mark_as_virtual_machine_result = client.call(:mark_as_virtual_machine) do message( { ‘_this’ => vm.ems_ref, :attributes! => { ‘type’ => “VirtualMachine”}, ‘pool’ => resource_pool_ems_ref } ).to_hash end likely in client.call(:mark_as_virtual_machine) as per the trace [----] E, [2017-09-18T12:36:27.467770 #2111:4aa344] ERROR – : [(ServerFaultCode) Attribute xsi:nil not allowed on element vim25:pool, which is not nillable. while parsing call information for method MarkAsVirtualMachine at line 1, column 239 while parsing SOAP body at line 1, column 229 while parsing SOAP envelope at line 1, column 38 while parsing HTTP request for method markAsVirtualMachine on object of type vim.VirtualMachine at line 1, column 0] /opt/rh/cfme-gemset/gems/savon-2.2.0/lib/savon/response.rb:70:in raise_soap_and_http_errors!' /opt/rh/cfme-gemset/gems/savon-2.2.0/lib/savon/response.rb:13:ininitialize’ /opt/rh/cfme-gemset/gems/savon-2.2.0/lib/savon/operation.rb:53:in new' /opt/rh/cfme-gemset/gems/savon-2.2.0/lib/savon/operation.rb:53:incall’ /opt/rh/cfme-gemset/gems/savon-2.2.0/lib/savon/client.rb:36:in call' /PitneyBowes/Integration/VMware/vCenter/MarkVMAsVirtualMachine:78:in

Can Kevin maybe add some input here?

Thanks


#2

Not sure, but could be that the task is using SOAP to speak to CFME
which is no longer supported, we removed the SOAP server side some
releases ago.

Though I would question why you need the essentials for this? We have
this out of the box, converting a template to vm and back again. (on
VMware) Just select VM or template NOT VM and Template view… :wink:

thanks


#3

Can you provide some screenshot sto that function? I only have “provision Vm’s using this template” and “clone selected template”. Nothing else looks like it will convert the template to a VM. I specifcally want ‘convert’ as there’s a number of snapshots that are used for linked clones which are lost when you clone the template to something new.

Thanks


#4

Sure, attached…hope this works by email!


#5

Sorry which one of those converts a template to a VM?
I see publish VM to a template but thats the wrong way round.

Thanks


#6

So we have provision from this, which would retain the template and give you a vm. You could then delete the template (using a custom button) I guess you want the feature that is convert template to vm? also Ansible does not seem to provide anything here so it will be back to the SOAP VIM API which is very nasty to work with. Sounds to me like a good RFE. I shall raise one and schedule.

Sorry which one of those converts a template to a VM?
I see publish VM to a template but thats the wrong way round.

Thanks

Visit Topic http://talk.manageiq.org/t/convert-to-vm-automate-essentials/2905/5 or reply to this email to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, click here http://talk.manageiq.org/email/unsubscribe/534374f8f20e0a905d3a2f2a91c917716944e8f8267a9105d0fe15a68be390b4.

Many Thanks,

JOHN HARDY
CLOUDFORMS
SENIOR PRINCIPAL PRODUCT MANAGER
Red Hat
jhardy@redhat.com M: +44-(0)7770-676866
www.cloudformsnow.com http://www.cloudformsnow.com/
TRIED. TESTED. TRUSTED.


#7

First you are correct that we only support cloning to template not converting which i wrote these methods to begin with. To be fair I haven’t touched these methods in a very long time but i imported them into my CloudForms 4.5 environment that is running vSphere 6.0 this evening and the only thing i had to change was to use the provider’s hostname instead of the ipaddress:

vcenter_mark_template_as_vm.rb

servername = vm.ext_management_system.hostname

vcenter_mark_vm_as_template.rb:

servername = vm.ext_management_system.hostname

The only thing i can think of is either there is something corrupt with the templates perhaps with the snapshots or with there is some incompatibility with the VM container version (i.e. vsphere version 11 versus 12, etc.)

Does the error only happen to that resource pool or all of them? What version of vSphere are running 6?


#8

Hi Kevin,

I’ve changed it to hostname instead of ipaddress & turned on debug mode.

We have Vcenter 6 with esxi 5.5 hosts - the HW version is 7.

I’ve attached the log:

template.log (20.0 KB)

Thanks!


#9

Thanks for the log. The problem appears to be that the resource pool is nil.

[----] I, [2017-11-14T10:47:22.638995 #12878:ab2f70] INFO – : Method STDOUT: D, [2017-11-14T10:47:22.637975 #26597] DEBUG – : <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd=“http://www.w3.org/2001/XMLSchema” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns:vim25=“urn:vim25” xmlns:env=“http://schemas.xmlsoap.org/soap/envelope/”>env:Bodyvim25:MarkAsVirtualMachinevim25:_thisvm-46370</vim25:_this><vim25:pool xsi:nil=“true”/></vim25:MarkAsVirtualMachine></env:Body></env:Envelope>

I am guessing there is something with your service dialog because if you take a closer look at your dump of the root objects in the beginning of the method you will notice that the $evm.root[‘dialog_resource_pool’] attribute is missing.

Can you supply the logs leading up to this with the dialog output?


#10

In fact i am wondering if you are evening running the service dialog at all. Please make sure that you are using the dialog with your button:


#11

Hi Kevin

That was it :slight_smile: I created this many months ago but didn’t realise there were specific dialogs for it. I did create my own dialog where the resource pool was hardcoded (name) to the default RP for the cluster but that doesn’t appear to have worked. Using the dynamiclist works perfect.

Many Thanks for your assistance!