def get_cluster_vm_resources(self): output = VM.get_vm_info_header() clusters = 0 vm_count = 0 for cluster in cloud_resources.resources: clusters += 1 vm_count += len(cluster.vms) output += cluster.get_cluster_vms_info() output += '\nTotal VMs: %i. Total Clouds: %i' % (vm_count, clusters) return output
def get_cluster_vm_resources(self): output = [] output.append(VM.get_vm_info_header()) clusters = 0 vm_count = 0 for cluster in cloud_resources.resources: clusters += 1 vm_count += len(cluster.vms) output.append(cluster.get_cluster_vms_info()) output.append('\nTotal VMs: %i. Total Clouds: %i' % (vm_count, clusters)) return ''.join(output)
def view_vm_resources(self): output = [] output.append(VM.get_vm_info_header()) clusters = 0 vm_count = 0 for cluster in web.cloud_resources.resources: clusters += 1 vm_count += len(cluster.vms) output.append(cluster.get_cluster_vms_info()) output.append('\nTotal VMs: %i. Total Clouds: %i' % (vm_count, clusters)) extra_output = [] for cluster in web.cloud_resources.retired_resources: extra_output.append(cluster.get_cluster_vms_info()) if len(extra_output) > 0: output.append('\n\nRetiring VMs from removing resources:\n') output.extend(extra_output) return ''.join(output)