This can be changed to: 

````
cluster = Cluster.objects.select_related("virtualmachine").get(slug=cluster_slug)
````
You can them remove vm_query set and get the VM's using cluster.virtual_machines.all() to get the VMs.

This will reduce the number of queries.