1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-01 05:47:01 +03:00

Feature #3227: Add vCenter and Hybrid IPs to VMs in Sunstone

This commit is contained in:
Tino Vazquez 2014-10-07 16:01:53 +02:00 committed by Ruben S. Montero
parent 897ccbd378
commit af330690a2

View File

@ -967,6 +967,29 @@ function str_start_time(vm){
// Return the IP or several IPs of a VM
function ip_str(vm){
if (vm.USER_TEMPLATE.HYPERVISOR)
{
switch(vm.USER_TEMPLATE.HYPERVISOR.toLowerCase())
{
case "vcenter":
ip = vm.TEMPLATE.GUEST_IP?vm.TEMPLATE.GUEST_IP:"--";
break;
case "ec2":
ip = vm.TEMPLATE.IP_ADDRESS?vm.TEMPLATE.IP_ADDRESS:"--";
break;
case "azure":
ip = vm.TEMPLATE.IPADDRESS?vm.TEMPLATE.IPADDRESS:"--";
break;
case "softlayer":
ip = vm.TEMPLATE.PRIMARYIPADDRESS?vm.TEMPLATE.PRIMARYIPADDRESS:"--";
break;
default:
ip = "--";
}
}
else
{
var nic = vm.TEMPLATE.NIC;
if (nic == undefined){
@ -991,6 +1014,7 @@ function ip_str(vm){
ip += value.IP6_ULA+'<br />';
}
});
}
return ip;
};