Is there the ability to get the Cloned VM Name from VM details in a Sandbox #49
-
|
Hi, Im trying to get the VM details of a VM within a running Sandbox, more specifically the Cloned VM name and path. Is there a way to do this? John Clarke (jclarke) - 01/20/2020 05:01 PM
|
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
|
What HyperVisor are you using? Kimo Saper (ksaper) - 01/21/2020 07:08 AM
|
Beta Was this translation helpful? Give feedback.
-
|
Hi John, Which version of CloudShell are you using? Steven Geller (Steven.G) - 01/21/2020 08:48 AM
|
Beta Was this translation helpful? Give feedback.
-
|
Hi, Thanks for response. @Kimo Saper I am using ESXI 6.7 and VMWare. Steven Geller we are using the latest Cloudshell. Im trying to get the Cloned VM path (base Image) from the Reservation using API GetReservationDetails(res_id).ReservationDescription.Resources.VmDetails I can return CloudProviderFullName but nothing else. John Clarke (jclarke) - 01/21/2020 10:51 AM
|
Beta Was this translation helpful? Give feedback.
-
|
Hi John, Try: output = api.GetResourceDetails(deployed_app_name) And then: output.VmDetails.InstanceData – VM Instance details (CPU, Memory, Snapshot Name, etc’) Additional VM details options include: output.VmDetails.NetworkData – VNIC Info output.VmDetails.VmCustomParams – Deployment path hidden parameters output.VMDetails. CloudProviderFullName – Cloud Provider Resource Name Steven Geller (Steven.G) - 01/21/2020 11:15 AM
|
Beta Was this translation helpful? Give feedback.
-
|
Hi Steven Geller so I've run a pprint(vars(Instance_data)) and get the following output. Instance Data list is empty. Instance_data = resource_details.VmDetails pprint(vars(Instance_data)) {'CloudProviderFullName': 'Redacted', John Clarke (jclarke) - 01/21/2020 12:18 PM
|
Beta Was this translation helpful? Give feedback.
-
|
Hi John, InstanceData is a list of cloudshell.api.cloudshell_api.VmInstanceParam type objects, each having a .Name and .Value field. Try this (the full script is attached): resource_details = api.GetResourceDetails(deployed_app_name) for instance_detail_item in resource_details.VmDetails.InstanceData : if instance_detail_item.Value: print “{0}:{1}”.format(instance_detail_item.Name, instance_detail_item.Value) Steven Geller (Steven.G) - 01/21/2020 01:19 AM
|
Beta Was this translation helpful? Give feedback.
-
|
Thanks Steven Geller John Clarke (jclarke) - 01/21/2020 01:50 AM
|
Beta Was this translation helpful? Give feedback.
Hi John,
InstanceData is a list of cloudshell.api.cloudshell_api.VmInstanceParam type objects, each having a .Name and .Value field.
Try this (the full script is attached):
resource_details = api.GetResourceDetails(deployed_app_name)
for instance_detail_item in resource_details.VmDetails.InstanceData :
if instance_detail_item.Value:
print “{0}:{1}”.format(instance_detail_item.Name, instance_detail_item.Value)
Steven Geller (Steven.G) - 01/21/2020 01:19 AM
· 4989 ·