diff --git a/hosting/templates/hosting/virtual_machine_detail.html b/hosting/templates/hosting/virtual_machine_detail.html
index e2f38d60..0b17878d 100644
--- a/hosting/templates/hosting/virtual_machine_detail.html
+++ b/hosting/templates/hosting/virtual_machine_detail.html
@@ -87,7 +87,7 @@
- {% trans "Configuration"%}: {{virtual_machine.get_configuration_display}}
+ {% trans "Configuration"%}: {{virtual_machine.configuration}}
diff --git a/opennebula_api/serializers.py b/opennebula_api/serializers.py
index 44b873a5..34e122d1 100644
--- a/opennebula_api/serializers.py
+++ b/opennebula_api/serializers.py
@@ -88,6 +88,7 @@ class VirtualMachineSerializer(serializers.Serializer):
state = serializers.CharField(read_only=True, source='str_state')
price = serializers.SerializerMethodField()
ssh_key = serializers.CharField(write_only=True)
+ configuration = serializers.SerializerMethodField()
template_id = serializers.ChoiceField(
choices=[(key.id, key.name) for key in
@@ -140,3 +141,7 @@ class VirtualMachineSerializer(serializers.Serializer):
for disk in template.disks:
price += int(disk.size)/1024 * 0.6
return price
+ def get_configuration(self, obj):
+ template_id = obj.template.template_id
+ template = OpenNebulaManager().get_template(template_id)
+ return template.name