From 1b94047bd877f12c2a0c6db6e79ac9bebaac6c72 Mon Sep 17 00:00:00 2001 From: Pranav Saxena Date: Wed, 27 Feb 2013 14:53:07 +0530 Subject: [PATCH 01/35] DV Switch UI Integration -Set 1 --- ui/scripts/system.js | 58 ++++++++++++++++++++++++++++++++++++++++ ui/scripts/zoneWizard.js | 57 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 113 insertions(+), 2 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 3d996129280..4e95652507e 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -7347,6 +7347,7 @@ docID: 'helpClusterHypervisor', select: function(args) { var vSwitchEnabled = false; + var dvSwitchEnabled = false; $.ajax({ url: createURL("listHypervisors"), @@ -7375,6 +7376,21 @@ } } }); + + //Check whether dvSwitch is enabled or not + $.ajax({ + url: createURL('listConfigurations'), + data: { + name: 'vmware.use.dvswitch' + }, + async: false, + success: function(json) { + if (json.listconfigurationsresponse.configuration[0].value == 'true') { + dvSwitchEnabled = true; + } + } + }); + args.$select.bind("change", function(event) { var $form = $(this).closest('form'); @@ -7390,6 +7406,16 @@ if ($(this).val() == "VMware") { //$('li[input_sub_group="external"]', $dialogAddCluster).show(); + + if(dvSwitchEnabled ){ + $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'inline-block'); + $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'inline-block'); + } + else { + $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'none'); + $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'none'); + + } $form.find('.form-item[rel=vCenterHost]').css('display', 'inline-block'); $form.find('.form-item[rel=vCenterUsername]').css('display', 'inline-block'); $form.find('.form-item[rel=vCenterPassword]').css('display', 'inline-block'); @@ -7453,6 +7479,31 @@ }, //hypervisor==VMWare begins here + vSwitchPublicType:{ + label: 'Public Traffic vSwitch Type', + select: function(args) { + var items = [] + + items.push({id: "" , description:" " }); + + items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); + items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); + args.response.success({data: items}); + }, + isHidden:true + }, + vSwitchGuestType:{ + label: 'Guest Traffic vSwitch Type', + select: function(args) { + var items = [] + items.push({id: "" , description:" " }); + items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); + items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); + args.response.success({data: items}); + }, + isHidden:true + }, + vCenterHost: { label: 'label.vcenter.host', docID: 'helpClustervCenterHost', @@ -7519,6 +7570,13 @@ if(args.data.hypervisor == "VMware") { array1.push("&username=" + todb(args.data.vCenterUsername)); array1.push("&password=" + todb(args.data.vCenterPassword)); + + if(args.data.vSwitchPublicType != "") + array1.push('&vswitchtypepublic=' + args.data.vSwitchPublicType); + + if(args.data.vSwitchGuestType != "") + array1.push('&vswitchtypeguest=' + args.data.vSwitchGuestType); + if (args.data.vsmipaddress) { array1.push('&vsmipaddress=' + args.data.vsmipaddress); diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js index 8b5171bd9c2..a5c52098421 100755 --- a/ui/scripts/zoneWizard.js +++ b/ui/scripts/zoneWizard.js @@ -732,7 +732,7 @@ }); var vSwitchEnabled = false; - + var dvSwitchEnabled = false; // Check whether vSwitch capability is enabled $.ajax({ url: createURL('listConfigurations'), @@ -747,6 +747,17 @@ } }); + //Check whether dvSwitch is enabled or not + $.ajax({ + url: createURL('listConfigurations'), + data: { + name: 'vmware.use.dvswitch' + }, + async: false, + success: function(json) { if (json.listconfigurationsresponse.configuration[0].value == 'true') { dvSwitchEnabled = true; + } + } }); + args.$select.bind("change", function(event) { var $form = $(this).closest('form'); var $vsmFields = $form.find('[rel]').filter(function() { @@ -761,6 +772,15 @@ if($(this).val() == "VMware") { //$('li[input_sub_group="external"]', $dialogAddCluster).show(); + if(dvSwitchEnabled ){ + $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'inline-block'); + $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'inline-block'); + } + else { + $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'none'); + $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'none'); + } + $form.find('[rel=vCenterHost]').css('display', 'block'); $form.find('[rel=vCenterUsername]').css('display', 'block'); $form.find('[rel=vCenterPassword]').css('display', 'block'); @@ -791,6 +811,32 @@ }, //hypervisor==VMWare begins here + + vSwitchPublicType:{ + label: 'Public Traffic vSwitch Type', + select: function(args) { + var items = [] + + items.push({id: " ", description: " "}); + + items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); + items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); + args.response.success({data: items}); + }, + isHidden:true + }, + vSwitchGuestType:{ + label: 'Guest Traffic vSwitch Type', + select: function(args) { + var items = [] + items.push({ id:" ", description:" "}); + + items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); + items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); + args.response.success({data: items}); + }, isHidden:true + }, + vCenterHost: { label: 'label.vcenter.host', validation: { required: true } @@ -2917,7 +2963,14 @@ array1.push("&username=" + todb(args.data.cluster.vCenterUsername)); array1.push("&password=" + todb(args.data.cluster.vCenterPassword)); - if (args.data.cluster.vsmipaddress) { // vSwitch is enabled + //dvswitch is enabled + if(args.data.cluster.vSwitchPublicType != "") + array1.push('&vswitchtypepublic=' + args.data.cluster.vSwitchPublicType); + + if(args.data.cluster.vSwitchGuestType != "") + array1.push('&vswitchtypeguest=' + args.data.cluster.vSwitchGuestType); + + if (args.data.cluster.vsmipaddress) { // vSwitch is enabled array1.push('&vsmipaddress=' + args.data.cluster.vsmipaddress); array1.push('&vsmusername=' + args.data.cluster.vsmusername); array1.push('&vsmpassword=' + args.data.cluster.vsmpassword); From 1f21c126878a23e5786aed2c740977299d7f1da2 Mon Sep 17 00:00:00 2001 From: Pranav Saxena Date: Wed, 27 Feb 2013 15:29:27 +0530 Subject: [PATCH 02/35] dvSwitch-UI Integration - Set 2 --- ui/scripts/system.js | 42 ++++++++++++++++++++++++++++++++++++++-- ui/scripts/zoneWizard.js | 41 +++++++++++++++++++++++++++++++++++---- 2 files changed, 77 insertions(+), 6 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 4e95652507e..3193a0aa83b 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -7479,6 +7479,20 @@ }, //hypervisor==VMWare begins here + + overridepublictraffic:{ + label:'Override Public-Traffic', + isBoolean:true + + }, + + overrideguesttraffic:{ + label:'Override Guest-Traffic', + isBoolean:true + + }, + + vSwitchPublicType:{ label: 'Public Traffic vSwitch Type', select: function(args) { @@ -7490,8 +7504,20 @@ items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); args.response.success({data: items}); }, - isHidden:true + isHidden:true, + dependsOn:'overridepublictraffic' }, + + vSwitchPublicName:{ + label:'vSwitch Public Traffic Name', + dependsOn:'overridepublictraffic', + isHidden:true + + + }, + + + vSwitchGuestType:{ label: 'Guest Traffic vSwitch Type', select: function(args) { @@ -7501,9 +7527,21 @@ items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); args.response.success({data: items}); }, - isHidden:true + isHidden:true, + dependsOn:'overrideguesttraffic' + }, + vSwitchGuestName:{ + label:'vSwitch Guest Traffic Name', + dependsOn:'overrideguesttraffic', + isHidden:true + + + }, + + + vCenterHost: { label: 'label.vcenter.host', docID: 'helpClustervCenterHost', diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js index a5c52098421..e6b5c1aa31a 100755 --- a/ui/scripts/zoneWizard.js +++ b/ui/scripts/zoneWizard.js @@ -811,6 +811,19 @@ }, //hypervisor==VMWare begins here + + overridepublictraffic:{ + label:'Override Public-Traffic', + isBoolean:true + + }, + + overrideguesttraffic:{ + label:'Override Guest-Traffic', + isBoolean:true + + }, + vSwitchPublicType:{ label: 'Public Traffic vSwitch Type', @@ -823,8 +836,19 @@ items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); args.response.success({data: items}); }, - isHidden:true - }, + isHidden:true, + dependsOn:'overridepublictraffic' + }, + + vSwitchPublicName:{ + label:'vSwitch Public Traffic Name', + dependsOn:'overridepublictraffic', + isHidden:true + + + }, + + vSwitchGuestType:{ label: 'Guest Traffic vSwitch Type', select: function(args) { @@ -834,8 +858,17 @@ items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); args.response.success({data: items}); - }, isHidden:true - }, + }, isHidden:true, + dependsOn:'overrideguesttraffic' + + }, + + vSwitchGuestName:{ + label:'vSwitch Guest Traffic Name', + dependsOn:'overrideguesttraffic', + isHidden:true + + }, vCenterHost: { label: 'label.vcenter.host', From bd583613622fed982e862625d077474a6c659fd8 Mon Sep 17 00:00:00 2001 From: Pranav Saxena Date: Wed, 27 Feb 2013 21:23:13 +0530 Subject: [PATCH 03/35] dvSwitch UI integration Set 2 --- ui/scripts/system.js | 175 +++++++++++++++++++++++---------------- ui/scripts/zoneWizard.js | 166 +++++++++++++++++++++++-------------- 2 files changed, 210 insertions(+), 131 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 3193a0aa83b..14a15aa1878 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -7408,12 +7408,27 @@ //$('li[input_sub_group="external"]', $dialogAddCluster).show(); if(dvSwitchEnabled ){ - $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'inline-block'); - $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'inline-block'); - } + // $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'inline-block'); + // $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'inline-block'); + // $form.find('.form-item[rel=vSwitchPublicName]').css('display','inline-block'); + //$form.find('.form-item[rel=vSwitchGuestName]').css('display','inline-block'); + $form.find('.form-item[rel=overridepublictraffic]').css('display','inline-block'); + $form.find('.form-item[rel=overridepublictraffic]').find('input[type=checkbox]').removeAttr('checked'); + + $form.find('.form-item[rel=overrideguesttraffic]').css('display','inline-block'); + $form.find('.form-item[rel=overrideguesttraffic]').find('input[type=checkbox]').removeAttr('checked'); + + + + } else { - $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'none'); - $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'none'); + // $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'none'); + // $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'none'); + // $form.find('.form-item[rel=vSwitchPublicName]').css('display','none'); + // $form.find('.form-item[rel=vSwitchGuestName]').css('display','none'); + $form.find('.form-item[rel=overridepublictraffic]').css('display','none'); + $form.find('.form-item[rel=overrideguesttraffic]').css('display','none'); + } $form.find('.form-item[rel=vCenterHost]').css('display', 'inline-block'); @@ -7427,6 +7442,16 @@ $vsmFields.css('display', 'none'); } } else { + + + $form.find('.form-item[rel=overridepublictraffic]').css('display', 'none'); + $form.find('.form-item[rel=overrideguesttraffic]').css('display', 'none'); + $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'none'); + $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'none'); + $form.find('.form-item[rel=vSwitchPublicName]').css('display','none'); + $form.find('.form-item[rel=vSwitchGuestName]').css('display','none'); + + $form.find('.form-item[rel=vCenterHost]').css('display', 'none'); $form.find('.form-item[rel=vCenterUsername]').css('display', 'none'); $form.find('.form-item[rel=vCenterPassword]').css('display', 'none'); @@ -7480,68 +7505,6 @@ //hypervisor==VMWare begins here - overridepublictraffic:{ - label:'Override Public-Traffic', - isBoolean:true - - }, - - overrideguesttraffic:{ - label:'Override Guest-Traffic', - isBoolean:true - - }, - - - vSwitchPublicType:{ - label: 'Public Traffic vSwitch Type', - select: function(args) { - var items = [] - - items.push({id: "" , description:" " }); - - items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); - items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); - args.response.success({data: items}); - }, - isHidden:true, - dependsOn:'overridepublictraffic' - }, - - vSwitchPublicName:{ - label:'vSwitch Public Traffic Name', - dependsOn:'overridepublictraffic', - isHidden:true - - - }, - - - - vSwitchGuestType:{ - label: 'Guest Traffic vSwitch Type', - select: function(args) { - var items = [] - items.push({id: "" , description:" " }); - items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); - items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); - args.response.success({data: items}); - }, - isHidden:true, - dependsOn:'overrideguesttraffic' - - }, - - vSwitchGuestName:{ - label:'vSwitch Guest Traffic Name', - dependsOn:'overrideguesttraffic', - isHidden:true - - - }, - - - vCenterHost: { label: 'label.vcenter.host', docID: 'helpClustervCenterHost', @@ -7563,6 +7526,70 @@ docID: 'helpClustervCenterDatacenter', validation: { required: true } }, + + overridepublictraffic:{ + label:'Override Public-Traffic', + isBoolean:true, + isHidden:true, + isChecked:false + + }, + + + vSwitchPublicType:{ + label: 'Public Traffic vSwitch Type', + select: function(args) { + var items = [] + + items.push({id: "" , description:" " }); + + items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); + items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); + args.response.success({data: items}); + }, + isHidden:true, + dependsOn:'overridepublictraffic' + }, + + vSwitchPublicName:{ + label:'Public Traffic vSwitch Name', + dependsOn:'overridepublictraffic', + isHidden:true + + + }, + + overrideguesttraffic:{ + label:'Override Guest-Traffic', + isBoolean:true, + isHidden:true, + isChecked:false + }, + + + vSwitchGuestType:{ + label: 'Guest Traffic vSwitch Type', + select: function(args) { + var items = [] + items.push({id: "" , description:" " }); + items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); + items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); + args.response.success({data: items}); + }, + isHidden:true, + dependsOn:'overrideguesttraffic' + + }, + + vSwitchGuestName:{ + label:' Guest Traffic vSwitch Name', + dependsOn:'overrideguesttraffic', + isHidden:true + + + }, + + vsmipaddress: { label: 'Nexus 1000v IP Address', validation: { required: true }, @@ -7609,12 +7636,20 @@ array1.push("&username=" + todb(args.data.vCenterUsername)); array1.push("&password=" + todb(args.data.vCenterPassword)); + //vSwitch Public Type if(args.data.vSwitchPublicType != "") - array1.push('&vswitchtypepublic=' + args.data.vSwitchPublicType); + array1.push("&vswitchtypepublic=" + args.data.vSwitchPublicType); - if(args.data.vSwitchGuestType != "") - array1.push('&vswitchtypeguest=' + args.data.vSwitchGuestType); + if(args.data.vSwitchPublicName != "") + array1.push("&publicvswitchname=" +args.data.vSwitchPublicName); + + //vSwitch Guest Type + if(args.data.vSwitchGuestType != "") + array1.push("&vswitchtypeguest=" + args.data.vSwitchGuestType); + + if(args.data.vSwitchGuestName !="") + array1.push("&guestvswitchname=" +args.data.vSwitchGuestName); if (args.data.vsmipaddress) { array1.push('&vsmipaddress=' + args.data.vsmipaddress); diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js index e6b5c1aa31a..95a7550d8d2 100755 --- a/ui/scripts/zoneWizard.js +++ b/ui/scripts/zoneWizard.js @@ -773,12 +773,32 @@ if($(this).val() == "VMware") { //$('li[input_sub_group="external"]', $dialogAddCluster).show(); if(dvSwitchEnabled ){ - $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'inline-block'); + /* $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'inline-block'); $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'inline-block'); - } + + $form.find('.form-item[rel=vSwitchPublicName]').css('display','inline-block'); + $form.find('.form-item[rel=vSwitchGuestName]').css('display','inline-block'); + + $form.find('.form-item[rel=overridepublictraffic]').find('input[type=checkbox]').css('display','inline-block'); + $form.find('.form-item[rel=overrideguesttraffic]').find('input[type=checkbox]').css('display','inline-block');*/ + + $form.find('.form-item[rel=overridepublictraffic]').css('display','inline-block'); + $form.find('.form-item[rel=overridepublictraffic]').find('input[type=checkbox]').removeAttr('checked'); + + $form.find('.form-item[rel=overrideguesttraffic]').css('display','inline-block'); + $form.find('.form-item[rel=overrideguesttraffic]').find('input[type=checkbox]').removeAttr('checked'); + + + + } else { - $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'none'); + /* $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'none'); $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'none'); + $form.find('.form-item[rel=vSwitchPublicName]').css('display','none'); + $form.find('.form-item[rel=vSwitchGuestName]').css('display','none');*/ + $form.find('.form-item[rel=overridepublictraffic]').css('display','none'); + $form.find('.form-item[rel=overrideguesttraffic]').css('display','none'); + } $form.find('[rel=vCenterHost]').css('display', 'block'); @@ -795,6 +815,15 @@ } else { //$('li[input_group="vmware"]', $dialogAddCluster).hide(); + + $form.find('.form-item[rel=overridepublictraffic]').css('display', 'none'); + $form.find('.form-item[rel=overrideguesttraffic]').css('display', 'none'); + $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'none'); + $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'none'); + $form.find('.form-item[rel=vSwitchPublicName]').css('display','none'); + $form.find('.form-item[rel=vSwitchGuestName]').css('display','none'); + + $form.find('[rel=vCenterHost]').css('display', 'none'); $form.find('[rel=vCenterUsername]').css('display', 'none'); $form.find('[rel=vCenterPassword]').css('display', 'none'); @@ -811,64 +840,6 @@ }, //hypervisor==VMWare begins here - - overridepublictraffic:{ - label:'Override Public-Traffic', - isBoolean:true - - }, - - overrideguesttraffic:{ - label:'Override Guest-Traffic', - isBoolean:true - - }, - - - vSwitchPublicType:{ - label: 'Public Traffic vSwitch Type', - select: function(args) { - var items = [] - - items.push({id: " ", description: " "}); - - items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); - items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); - args.response.success({data: items}); - }, - isHidden:true, - dependsOn:'overridepublictraffic' - }, - - vSwitchPublicName:{ - label:'vSwitch Public Traffic Name', - dependsOn:'overridepublictraffic', - isHidden:true - - - }, - - - vSwitchGuestType:{ - label: 'Guest Traffic vSwitch Type', - select: function(args) { - var items = [] - items.push({ id:" ", description:" "}); - - items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); - items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); - args.response.success({data: items}); - }, isHidden:true, - dependsOn:'overrideguesttraffic' - - }, - - vSwitchGuestName:{ - label:'vSwitch Guest Traffic Name', - dependsOn:'overrideguesttraffic', - isHidden:true - - }, vCenterHost: { label: 'label.vcenter.host', @@ -887,6 +858,70 @@ label: 'label.vcenter.datacenter', validation: { required: true } }, + + overridepublictraffic:{ + label:'Override Public-Traffic', + isBoolean:true, + isHidden:true + + }, + + + vSwitchPublicType:{ + label: 'Public Traffic vSwitch Type', + select: function(args) { + var items = [] + + items.push({id: " ", description: " "}); + + items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); + items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); + args.response.success({data: items}); + }, + isHidden:true, + dependsOn:'overridepublictraffic' + }, + + vSwitchPublicName:{ + label:'vSwitch Public Traffic Name', + dependsOn:'overridepublictraffic', + isHidden:true + + + }, + + overrideguesttraffic:{ + label:'Override Guest-Traffic', + isBoolean:true, + isHidden:true + + }, + + + vSwitchGuestType:{ + label: 'Guest Traffic vSwitch Type', + select: function(args) { + var items = [] + items.push({ id:" ", description:" "}); + + items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); + items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); + + args.response.success({data: items}); + + }, isHidden:true, + dependsOn:'overrideguesttraffic' + + }, + + vSwitchGuestName:{ + label:'vSwitch Guest Traffic Name', + dependsOn:'overrideguesttraffic', + isHidden:true + + }, + + //Cisco Nexus Vswitch vsmipaddress: { label: 'Nexus 1000v IP Address', validation: { required: true }, @@ -3000,9 +3035,18 @@ if(args.data.cluster.vSwitchPublicType != "") array1.push('&vswitchtypepublic=' + args.data.cluster.vSwitchPublicType); + if(args.data.cluster.vSwitchPublicName != "") + array1.push("&publicvswitchname=" +args.data.cluster.vSwitchPublicName); + + + if(args.data.cluster.vSwitchGuestType != "") array1.push('&vswitchtypeguest=' + args.data.cluster.vSwitchGuestType); + if(args.data.cluster.vSwitchGuestName !="") + array1.push("&guestvswitchname=" +args.data.cluster.vSwitchGuestName); + + if (args.data.cluster.vsmipaddress) { // vSwitch is enabled array1.push('&vsmipaddress=' + args.data.cluster.vsmipaddress); array1.push('&vsmusername=' + args.data.cluster.vsmusername); From c28938091099ecb05f541fe595d60af1869d183a Mon Sep 17 00:00:00 2001 From: Pranav Saxena Date: Wed, 27 Feb 2013 21:52:47 +0530 Subject: [PATCH 04/35] dvswitch UI integration set 3 --- ui/scripts/system.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 14a15aa1878..24a1c5911b5 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -7541,10 +7541,12 @@ select: function(args) { var items = [] - items.push({id: "" , description:" " }); + // items.push({id: "" , description:" " }); items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); + + items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"}); args.response.success({data: items}); }, isHidden:true, @@ -7571,9 +7573,12 @@ label: 'Guest Traffic vSwitch Type', select: function(args) { var items = [] - items.push({id: "" , description:" " }); + // items.push({id: "" , description:" " }); items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); + + items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"}); + args.response.success({data: items}); }, isHidden:true, @@ -7638,7 +7643,7 @@ //vSwitch Public Type if(args.data.vSwitchPublicType != "") - array1.push("&vswitchtypepublic=" + args.data.vSwitchPublicType); + array1.push("&publicvswitchtype=" + args.data.vSwitchPublicType); if(args.data.vSwitchPublicName != "") array1.push("&publicvswitchname=" +args.data.vSwitchPublicName); @@ -7646,7 +7651,7 @@ //vSwitch Guest Type if(args.data.vSwitchGuestType != "") - array1.push("&vswitchtypeguest=" + args.data.vSwitchGuestType); + array1.push("&guestvswitchtype=" + args.data.vSwitchGuestType); if(args.data.vSwitchGuestName !="") array1.push("&guestvswitchname=" +args.data.vSwitchGuestName); From 08b2f7734bc9c7968954a1235b32881e017861bf Mon Sep 17 00:00:00 2001 From: Pranav Saxena Date: Wed, 27 Feb 2013 23:44:02 +0530 Subject: [PATCH 05/35] dvswitch UI integration Complete - Set 4 --- ui/scripts/system.js | 72 ++++++++++++++++++++++++++++++++++++---- ui/scripts/zoneWizard.js | 71 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 131 insertions(+), 12 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 24a1c5911b5..c564b0b2db3 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -7407,7 +7407,7 @@ if ($(this).val() == "VMware") { //$('li[input_sub_group="external"]', $dialogAddCluster).show(); - if(dvSwitchEnabled ){ + if(dvSwitchEnabled == false){ // $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'inline-block'); // $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'inline-block'); // $form.find('.form-item[rel=vSwitchPublicName]').css('display','inline-block'); @@ -7539,14 +7539,42 @@ vSwitchPublicType:{ label: 'Public Traffic vSwitch Type', select: function(args) { - var items = [] + var vSwitchEnabled = false; + var items = [] + $.ajax({ + url: createURL('listConfigurations'), + data: { + name: 'vmware.use.nexus.vswitch' + }, + async: false, + success: function(json) { + if (json.listconfigurationsresponse.configuration[0].value == 'true') { + vSwitchEnabled = true; + } + } + }); - // items.push({id: "" , description:" " }); + if(vSwitchEnabled) { + + items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"}); items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); - + + + + + } + + // items.push({id: "" , description:" " }); + else{ + items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); + items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); + + items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"}); + } + args.response.success({data: items}); }, isHidden:true, @@ -7574,11 +7602,41 @@ select: function(args) { var items = [] // items.push({id: "" , description:" " }); - items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); - items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); - + + var vSwitchEnabled = false; + $.ajax({ + url: createURL('listConfigurations'), + data: { + name: 'vmware.use.nexus.vswitch' + }, + async: false, + success: function(json) { + if (json.listconfigurationsresponse.configuration[0].value == 'true') { + vSwitchEnabled = true; + } + } + }); + + + if(vSwitchEnabled){ items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"}); + items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); + items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); + + + } + + + else{ + + items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); + items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); + + items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"}); + + + } args.response.success({data: items}); }, isHidden:true, diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js index 95a7550d8d2..b18334a3c89 100755 --- a/ui/scripts/zoneWizard.js +++ b/ui/scripts/zoneWizard.js @@ -772,7 +772,7 @@ if($(this).val() == "VMware") { //$('li[input_sub_group="external"]', $dialogAddCluster).show(); - if(dvSwitchEnabled ){ + if(dvSwitchEnabled == false){ /* $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'inline-block'); $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'inline-block'); @@ -871,11 +871,41 @@ label: 'Public Traffic vSwitch Type', select: function(args) { var items = [] + var vSwitchEnabled = false; + $.ajax({ + url: createURL('listConfigurations'), + data: { + name: 'vmware.use.nexus.vswitch' + }, + async: false, + success: function(json) { + if (json.listconfigurationsresponse.configuration[0].value == 'true') { + vSwitchEnabled = true; + } + } + }); - items.push({id: " ", description: " "}); + if(vSwitchEnabled) { + items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"}); + + items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); + items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); + + + + + } + + // items.push({id: " ", description: " "}); + else{ items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); + + + items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"}); + + } args.response.success({data: items}); }, isHidden:true, @@ -902,11 +932,42 @@ label: 'Guest Traffic vSwitch Type', select: function(args) { var items = [] - items.push({ id:" ", description:" "}); + //items.push({ id:" ", description:" "}); + + var vSwitchEnabled = false; + var items = [] + $.ajax({ + url: createURL('listConfigurations'), + data: { + name: 'vmware.use.nexus.vswitch' + }, + async: false, + success: function(json) { + if (json.listconfigurationsresponse.configuration[0].value == 'true') { + vSwitchEnabled = true; + } + } + }); + + if(vSwitchEnabled) { + + items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"}); + + items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); + items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); + + + + + } + else{ items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); + items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"}); + + } args.response.success({data: items}); }, isHidden:true, @@ -3033,7 +3094,7 @@ //dvswitch is enabled if(args.data.cluster.vSwitchPublicType != "") - array1.push('&vswitchtypepublic=' + args.data.cluster.vSwitchPublicType); + array1.push('&publicvswitchtype=' + args.data.cluster.vSwitchPublicType); if(args.data.cluster.vSwitchPublicName != "") array1.push("&publicvswitchname=" +args.data.cluster.vSwitchPublicName); @@ -3041,7 +3102,7 @@ if(args.data.cluster.vSwitchGuestType != "") - array1.push('&vswitchtypeguest=' + args.data.cluster.vSwitchGuestType); + array1.push('&guestvswitchtype=' + args.data.cluster.vSwitchGuestType); if(args.data.cluster.vSwitchGuestName !="") array1.push("&guestvswitchname=" +args.data.cluster.vSwitchGuestName); From b07f482bac38b377ba8ff13d0ce40f73677b2e9d Mon Sep 17 00:00:00 2001 From: Pranav Saxena Date: Thu, 28 Feb 2013 00:15:04 +0530 Subject: [PATCH 06/35] dvswitch UI integration Complete:Enabling the flag - Set 4 --- ui/scripts/system.js | 2 +- ui/scripts/zoneWizard.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index c564b0b2db3..334993b22c9 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -7407,7 +7407,7 @@ if ($(this).val() == "VMware") { //$('li[input_sub_group="external"]', $dialogAddCluster).show(); - if(dvSwitchEnabled == false){ + if(dvSwitchEnabled){ // $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'inline-block'); // $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'inline-block'); // $form.find('.form-item[rel=vSwitchPublicName]').css('display','inline-block'); diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js index b18334a3c89..883553ccbd4 100755 --- a/ui/scripts/zoneWizard.js +++ b/ui/scripts/zoneWizard.js @@ -772,7 +772,7 @@ if($(this).val() == "VMware") { //$('li[input_sub_group="external"]', $dialogAddCluster).show(); - if(dvSwitchEnabled == false){ + if(dvSwitchEnabled ){ /* $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'inline-block'); $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'inline-block'); From 9afd33d206f61909711ac4f170a461c8339df509 Mon Sep 17 00:00:00 2001 From: Prachi Damle Date: Wed, 27 Feb 2013 16:56:14 -0800 Subject: [PATCH 07/35] CLOUDSTACK-1418- As regular user , we are not allowed to deploy VM on a shared network. - Added the access type attribute to @acl - Domainchecker needs the AccessType.UseNetwork value specified to check access to network --- api/src/org/apache/cloudstack/api/ACL.java | 4 ++++ .../api/command/user/vm/DeployVMCmd.java | 4 ++-- server/src/com/cloud/api/ApiDispatcher.java | 20 ++++++++++--------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/ACL.java b/api/src/org/apache/cloudstack/api/ACL.java index 3623d1ac523..ce93b6aa7ae 100644 --- a/api/src/org/apache/cloudstack/api/ACL.java +++ b/api/src/org/apache/cloudstack/api/ACL.java @@ -22,10 +22,14 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import org.apache.cloudstack.acl.SecurityChecker.AccessType; + @Retention(RetentionPolicy.RUNTIME) @Target({ FIELD }) public @interface ACL { + AccessType accessType() default AccessType.ListEntry; + boolean checkKeyAccess() default false; boolean checkValueAccess() default false; } diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java index 0ac6476cf43..21a45f8cc7f 100755 --- a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java @@ -24,6 +24,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; @@ -53,7 +54,6 @@ import com.cloud.exception.InvalidParameterValueException; import com.cloud.exception.ResourceAllocationException; import com.cloud.exception.ResourceUnavailableException; import com.cloud.hypervisor.Hypervisor.HypervisorType; -import com.cloud.network.IpAddress; import com.cloud.network.Network; import com.cloud.network.Network.IpAddresses; import com.cloud.offering.DiskOffering; @@ -103,7 +103,7 @@ public class DeployVMCmd extends BaseAsyncCreateCmd { private Long domainId; //Network information - @ACL + @ACL(accessType = AccessType.UseNetwork) @Parameter(name=ApiConstants.NETWORK_IDS, type=CommandType.LIST, collectionType=CommandType.UUID, entityType=NetworkResponse.class, description="list of network ids used by virtual machine. Can't be specified with ipToNetworkList parameter") private List networkIds; diff --git a/server/src/com/cloud/api/ApiDispatcher.java b/server/src/com/cloud/api/ApiDispatcher.java index 8e3c5e01bfd..cf86afc7fe6 100755 --- a/server/src/com/cloud/api/ApiDispatcher.java +++ b/server/src/com/cloud/api/ApiDispatcher.java @@ -24,6 +24,7 @@ import java.text.ParseException; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -35,6 +36,7 @@ import javax.inject.Inject; import org.apache.cloudstack.acl.ControlledEntity; import org.apache.cloudstack.acl.InfrastructureEntity; +import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -87,7 +89,7 @@ public class ApiDispatcher { public ApiDispatcher() { } - + @PostConstruct void init() { s_instance = this; @@ -106,7 +108,7 @@ public class ApiDispatcher { } - private void doAccessChecks(BaseCmd cmd, List entitiesToAccess) { + private void doAccessChecks(BaseCmd cmd, Map entitiesToAccess) { Account caller = UserContext.current().getCaller(); Account owner = _accountMgr.getActiveAccountById(cmd.getEntityOwnerId()); @@ -118,9 +120,9 @@ public class ApiDispatcher { if(!entitiesToAccess.isEmpty()){ //check that caller can access the owner account. _accountMgr.checkAccess(caller, null, true, owner); - for(Object entity : entitiesToAccess) { + for (Object entity : entitiesToAccess.keySet()) { if (entity instanceof ControlledEntity) { - _accountMgr.checkAccess(caller, null, true, (ControlledEntity) entity); + _accountMgr.checkAccess(caller, entitiesToAccess.get(entity), true, (ControlledEntity) entity); } else if (entity instanceof InfrastructureEntity) { //FIXME: Move this code in adapter, remove code from Account manager @@ -162,11 +164,11 @@ public class ApiDispatcher { @SuppressWarnings({ "unchecked", "rawtypes" }) public static void processParameters(BaseCmd cmd, Map params) { - List entitiesToAccess = new ArrayList(); + Map entitiesToAccess = new HashMap(); Map unpackedParams = cmd.unpackParams(params); - + cmd = ComponentContext.getTargetObject(cmd); - + if (cmd instanceof BaseListCmd) { Object pageSizeObj = unpackedParams.get(ApiConstants.PAGE_SIZE); Long pageSize = null; @@ -258,7 +260,7 @@ public class ApiDispatcher { List listParam = (List) field.get(cmd); for (Long entityId : listParam) { Object entityObj = s_instance._entityMgr.findById(entity, entityId); - entitiesToAccess.add(entityObj); + entitiesToAccess.put(entityObj, checkAccess.accessType()); } break; /* @@ -279,7 +281,7 @@ public class ApiDispatcher { case LONG: case UUID: Object entityObj = s_instance._entityMgr.findById(entity, (Long) field.get(cmd)); - entitiesToAccess.add(entityObj); + entitiesToAccess.put(entityObj, checkAccess.accessType()); break; default: break; From 91417115ef119633c321234c5db5dc64ba93b239 Mon Sep 17 00:00:00 2001 From: Mice Xia Date: Thu, 28 Feb 2013 11:46:10 +0800 Subject: [PATCH 08/35] CLOUDSTACK-1401 NPE: listCapacity --- .../src/com/cloud/capacity/dao/CapacityDaoImpl.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/capacity/dao/CapacityDaoImpl.java b/server/src/com/cloud/capacity/dao/CapacityDaoImpl.java index 3aef29b954a..1c23cb8e5e1 100755 --- a/server/src/com/cloud/capacity/dao/CapacityDaoImpl.java +++ b/server/src/com/cloud/capacity/dao/CapacityDaoImpl.java @@ -305,10 +305,17 @@ public class CapacityDaoImpl extends GenericDaoBase implements } ResultSet rs = pstmt.executeQuery(); while (rs.next()) { + Long capacityPodId = null; + Long capacityClusterId = null; + + if(level != 1 && rs.getLong(6) != 0) + capacityPodId = rs.getLong(6); + if(level == 3 && rs.getLong(7) != 0) + capacityClusterId = rs.getLong(7); + SummedCapacity summedCapacity = new SummedCapacity( rs.getLong(1), rs.getLong(2), rs.getFloat(3), (short)rs.getLong(4), rs.getLong(5), - level != 1 ? rs.getLong(6): null, - level == 3 ? rs.getLong(7): null); + capacityPodId, capacityClusterId); result.add(summedCapacity); } From e5bf4a8fc4b0535a3d089708d6f19ac65fada2be Mon Sep 17 00:00:00 2001 From: Mice Xia Date: Thu, 28 Feb 2013 11:49:12 +0800 Subject: [PATCH 09/35] CLOUDSTACK-1434 BeanCreationException: Error creating bean with name 'apiRateLimitServiceImpl' when starting up mgmt server --- client/tomcatconf/nonossComponentContext.xml.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/tomcatconf/nonossComponentContext.xml.in b/client/tomcatconf/nonossComponentContext.xml.in index 35e1b28dc7e..ba618756c69 100644 --- a/client/tomcatconf/nonossComponentContext.xml.in +++ b/client/tomcatconf/nonossComponentContext.xml.in @@ -115,13 +115,14 @@ - + - + From 398b049327020a59f88e445433bd0294ef8b7be4 Mon Sep 17 00:00:00 2001 From: Mice Xia Date: Thu, 28 Feb 2013 11:50:07 +0800 Subject: [PATCH 10/35] add license header for a js file reported by rat --- ui/scripts/ui-custom/regions.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ui/scripts/ui-custom/regions.js b/ui/scripts/ui-custom/regions.js index 744a9d9ecb3..02496726903 100644 --- a/ui/scripts/ui-custom/regions.js +++ b/ui/scripts/ui-custom/regions.js @@ -1,3 +1,20 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + (function($, cloudStack) { $(window).bind('cloudStack.ready', function() { // Region switcher From c25a0d8d8ebd4419efc1587656d6ae2803d8733b Mon Sep 17 00:00:00 2001 From: Pranav Saxena Date: Thu, 28 Feb 2013 11:54:04 +0530 Subject: [PATCH 11/35] Displaying persistent network property in the detail view for VPC networks --- ui/scripts/network.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/scripts/network.js b/ui/scripts/network.js index daa09c78f3e..6fcd46040ef 100755 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -4447,6 +4447,11 @@ cidr: { label: 'label.cidr' }, networkdomain: { label: 'label.network.domain' }, state: { label: 'label.state' }, + ispersistent:{ + label:'Persistent ', + converter:cloudStack.converters.toBooleanText + + }, restartrequired: { label: 'label.restart.required', converter: function(booleanValue) { From b1fd37165564a590a9f593ac6940af39c9e794ac Mon Sep 17 00:00:00 2001 From: Pranav Saxena Date: Thu, 28 Feb 2013 12:16:50 +0530 Subject: [PATCH 12/35] Vmware dvSwitch UI integration - tooltips --- ui/scripts/docs.js | 14 ++++++++++++++ ui/scripts/system.js | 7 +++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ui/scripts/docs.js b/ui/scripts/docs.js index 5a38613f076..0ccedc5ddb1 100755 --- a/ui/scripts/docs.js +++ b/ui/scripts/docs.js @@ -20,6 +20,20 @@ cloudStack.docs = { desc: 'Any desired login ID. Must be unique in the current domain. The same username can exist in other domains, including sub-domains.', externalLink: '' }, + + helpOverridePublicNetwork:{ + desc:'Choose to override zone wide traffic label for guest traffic for this cluster', + externalLink:'' + + }, + + helpOverrideGuestNetwork:{ + + desc:'Choose to override zone wide traffic label for guest traffic for this cluster', + externalLink:'' + + }, + helpAccountPassword: { desc: 'Any desired password', externalLink: '' diff --git a/ui/scripts/system.js b/ui/scripts/system.js index d73b9f46690..d5c2a4c1022 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -7531,7 +7531,8 @@ label:'Override Public-Traffic', isBoolean:true, isHidden:true, - isChecked:false + isChecked:false, + docID:'helpOverridePublicNetwork' }, @@ -7593,7 +7594,9 @@ label:'Override Guest-Traffic', isBoolean:true, isHidden:true, - isChecked:false + isChecked:false, + docID:'helpOverrideGuestNetwork' + }, From 644a73bb2f024bff31536a87390917c6ac700b3f Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Thu, 28 Feb 2013 13:19:24 +0530 Subject: [PATCH 13/35] CLOUDSTACK-1340: Don't remove all scripts in /root, rm only those copied by veewee Signed-off-by: Rohit Yadav --- tools/appliance/definitions/systemvmtemplate/zerodisk.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/appliance/definitions/systemvmtemplate/zerodisk.sh b/tools/appliance/definitions/systemvmtemplate/zerodisk.sh index 3fc80f7a704..cb793084f73 100644 --- a/tools/appliance/definitions/systemvmtemplate/zerodisk.sh +++ b/tools/appliance/definitions/systemvmtemplate/zerodisk.sh @@ -1,5 +1,6 @@ # Clean up stuff copied in by veewee -rm -f /root/* +rm -fv /root/*.iso +rm -fv /root/base.sh /root/cleanup.sh /root/postinstall.sh /root/zerodisk.sh echo "Cleaning up" From 9446eba78c899f3bf7b940e3e009e57e00f51efe Mon Sep 17 00:00:00 2001 From: Pranav Saxena Date: Thu, 28 Feb 2013 13:27:27 +0530 Subject: [PATCH 14/35] CLOUDSTACK-1447:Persistent Status is not displayed for VPC Tiers --- ui/scripts/vpc.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js index c198a91c52b..4281ca283fa 100644 --- a/ui/scripts/vpc.js +++ b/ui/scripts/vpc.js @@ -1690,6 +1690,13 @@ state: { label: 'label.state' }, + + ispersistent:{ + label:'Persistent ', + converter:cloudStack.converters.toBooleanText + + }, + restartrequired: { label: 'label.restart.required', converter: function(booleanValue) { From 6a46656c7238b12bd7fdea9848524b0a7e08c903 Mon Sep 17 00:00:00 2001 From: Mice Xia Date: Thu, 28 Feb 2013 16:30:10 +0800 Subject: [PATCH 15/35] CLOUDSTACK-1448 Failed to start VM with standard vSwitch on VMware --- .../hypervisor/vmware/VmwareServerDiscoverer.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java index d7c237d3b2d..90fe461e5cb 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java @@ -169,7 +169,7 @@ public class VmwareServerDiscoverer extends DiscovererBase implements paramGuestVswitchName = _urlParams.get(ApiConstants.VSWITCH_NAME_GUEST_TRAFFIC); paramPublicVswitchType = _urlParams.get(ApiConstants.VSWITCH_TYPE_PUBLIC_TRAFFIC); paramPublicVswitchName = _urlParams.get(ApiConstants.VSWITCH_NAME_PUBLIC_TRAFFIC); - defaultVirtualSwitchType = getDefaultVirtualSwitchType(nexusDVS); + defaultVirtualSwitchType = getDefaultVirtualSwitchType(); } // Get zone wide traffic labels for Guest traffic and Public traffic guestTrafficLabel = _netmgr.getDefaultGuestTrafficLabel(dcId, HypervisorType.VMware); @@ -591,7 +591,7 @@ public class VmwareServerDiscoverer extends DiscovererBase implements String guestTrafficLabel = _netmgr.getDefaultGuestTrafficLabel(host.getDataCenterId(), HypervisorType.VMware); String publicTrafficLabel = _netmgr.getDefaultPublicTrafficLabel(host.getDataCenterId(), HypervisorType.VMware); _readGlobalConfigParameters(); - VirtualSwitchType defaultVirtualSwitchType = getDefaultVirtualSwitchType(nexusDVS); + VirtualSwitchType defaultVirtualSwitchType = getDefaultVirtualSwitchType(); params.put("guestTrafficInfo", getTrafficInfo(TrafficType.Guest, guestTrafficLabel, clusterDetails, defaultVirtualSwitchType)); params.put("publicTrafficInfo", getTrafficInfo(TrafficType.Public, publicTrafficLabel, clusterDetails, defaultVirtualSwitchType)); @@ -599,8 +599,13 @@ public class VmwareServerDiscoverer extends DiscovererBase implements return params; } - private VirtualSwitchType getDefaultVirtualSwitchType(boolean nexusDVS) { - return nexusDVS ? VirtualSwitchType.NexusDistributedVirtualSwitch : VirtualSwitchType.VMwareDistributedVirtualSwitch; + private VirtualSwitchType getDefaultVirtualSwitchType() { + if (nexusDVS) + return VirtualSwitchType.NexusDistributedVirtualSwitch; + else if(useDVS) + return VirtualSwitchType.VMwareDistributedVirtualSwitch; + else + return VirtualSwitchType.StandardVirtualSwitch; } @Override From 1d31c3ecaf7466e3e8bb1ce08d413f3a88b4323a Mon Sep 17 00:00:00 2001 From: Kishan Kavala Date: Thu, 28 Feb 2013 11:20:35 +0530 Subject: [PATCH 16/35] CLOUDSTACK-241: Moved regions upgrade changes to Upgrade40to41.jav from schema file. Sets the right regins_id from db.properties instead of using default 1. Conflicts: setup/db/db/schema-40to410.sql --- .../cloud/server/ConfigurationServerImpl.java | 22 ++--- .../com/cloud/upgrade/dao/Upgrade40to41.java | 94 ++++++++++++++----- setup/db/db/schema-40to410.sql | 3 +- 3 files changed, 82 insertions(+), 37 deletions(-) diff --git a/server/src/com/cloud/server/ConfigurationServerImpl.java b/server/src/com/cloud/server/ConfigurationServerImpl.java index 6bf7f955269..9566285051d 100755 --- a/server/src/com/cloud/server/ConfigurationServerImpl.java +++ b/server/src/com/cloud/server/ConfigurationServerImpl.java @@ -130,7 +130,6 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio @Inject private ResourceCountDao _resourceCountDao; @Inject private NetworkOfferingServiceMapDao _ntwkOfferingServiceMapDao; @Inject private IdentityDao _identityDao; - @Inject private RegionDao _regionDao; public ConfigurationServerImpl() { setRunLevel(ComponentLifecycle.RUN_LEVEL_FRAMEWORK_BOOTSTRAP); @@ -234,8 +233,6 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio // Create default networks createDefaultNetworks(); - createDefaultRegion(); - // Create userIpAddress ranges // Update existing vlans with networkId @@ -338,21 +335,23 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio @DB protected void saveUser() { - //ToDo: Add regionId to default users and accounts + int region_id = _configDao.getRegionId(); // insert system account - String insertSql = "INSERT INTO `cloud`.`account` (id, uuid, account_name, type, domain_id, region_id) VALUES (1, UUID(), 'system', '1', '1', '1')"; + String insertSql = "INSERT INTO `cloud`.`account` (id, uuid, account_name, type, domain_id, region_id) VALUES (1, UUID(), 'system', '1', '1', ?)"; Transaction txn = Transaction.currentTxn(); try { PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql); + stmt.setInt(1, region_id); stmt.executeUpdate(); } catch (SQLException ex) { } // insert system user insertSql = "INSERT INTO `cloud`.`user` (id, uuid, username, password, account_id, firstname, lastname, created, region_id)" + - " VALUES (1, UUID(), 'system', RAND(), 1, 'system', 'cloud', now(), '1')"; + " VALUES (1, UUID(), 'system', RAND(), 1, 'system', 'cloud', now(), ?)"; txn = Transaction.currentTxn(); try { PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql); + stmt.setInt(1, region_id); stmt.executeUpdate(); } catch (SQLException ex) { } @@ -365,21 +364,23 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio String lastname = "cloud"; // create an account for the admin user first - insertSql = "INSERT INTO `cloud`.`account` (id, uuid, account_name, type, domain_id, region_id) VALUES (" + id + ", UUID(), '" + username + "', '1', '1', '1')"; + insertSql = "INSERT INTO `cloud`.`account` (id, uuid, account_name, type, domain_id, region_id) VALUES (" + id + ", UUID(), '" + username + "', '1', '1', ?)"; txn = Transaction.currentTxn(); try { PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql); + stmt.setInt(1, region_id); stmt.executeUpdate(); } catch (SQLException ex) { } // now insert the user insertSql = "INSERT INTO `cloud`.`user` (id, uuid, username, password, account_id, firstname, lastname, created, state, region_id) " + - "VALUES (" + id + ", UUID(), '" + username + "', RAND(), 2, '" + firstname + "','" + lastname + "',now(), 'disabled', '1')"; + "VALUES (" + id + ", UUID(), '" + username + "', RAND(), 2, '" + firstname + "','" + lastname + "',now(), 'disabled', ?)"; txn = Transaction.currentTxn(); try { PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql); + stmt.setInt(1, region_id); stmt.executeUpdate(); } catch (SQLException ex) { } @@ -1272,9 +1273,4 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio return svcProviders; } - private void createDefaultRegion(){ - //Get Region name and URL from db.properties - _regionDao.persist(new RegionVO(_regionDao.getRegionId(), "Local", "http://localhost:8080/client/api", "", "")); - } - } diff --git a/server/src/com/cloud/upgrade/dao/Upgrade40to41.java b/server/src/com/cloud/upgrade/dao/Upgrade40to41.java index e7fea237700..92687643185 100644 --- a/server/src/com/cloud/upgrade/dao/Upgrade40to41.java +++ b/server/src/com/cloud/upgrade/dao/Upgrade40to41.java @@ -17,6 +17,7 @@ package com.cloud.upgrade.dao; +import com.cloud.utils.db.Transaction; import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.utils.script.Script; @@ -33,48 +34,95 @@ import java.util.UUID; import org.apache.log4j.Logger; public class Upgrade40to41 implements DbUpgrade { - final static Logger s_logger = Logger.getLogger(Upgrade40to41.class); + final static Logger s_logger = Logger.getLogger(Upgrade40to41.class); - @Override - public String[] getUpgradableVersionRange() { - return new String[] { "4.0.0", "4.1.0" }; - } + @Override + public String[] getUpgradableVersionRange() { + return new String[] { "4.0.0", "4.1.0" }; + } - @Override - public String getUpgradedVersion() { - return "4.1.0"; - } + @Override + public String getUpgradedVersion() { + return "4.1.0"; + } - @Override - public boolean supportsRollingUpgrade() { - return false; - } + @Override + public boolean supportsRollingUpgrade() { + return false; + } - @Override - public File[] getPrepareScripts() { - String script = Script.findScript("", "db/schema-40to410.sql"); + @Override + public File[] getPrepareScripts() { + String script = Script.findScript("", "db/schema-40to410.sql"); if (script == null) { throw new CloudRuntimeException("Unable to find db/schema-40to410.sql"); } return new File[] { new File(script) }; - } + } - @Override - public void performDataMigration(Connection conn) { + @Override + public void performDataMigration(Connection conn) { + updateRegionEntries(conn); upgradeEIPNetworkOfferings(conn); upgradeEgressFirewallRules(conn); - } + } - @Override - public File[] getCleanupScripts() { + @Override + public File[] getCleanupScripts() { String script = Script.findScript("", "db/schema-40to410-cleanup.sql"); if (script == null) { throw new CloudRuntimeException("Unable to find db/schema-40to410-cleanup.sql"); } return new File[] { new File(script) }; - } + } + + private void updateRegionEntries(Connection conn) { + int region_id = Transaction.s_region_id; + PreparedStatement pstmt = null; + try { + //Update regionId in region table + s_logger.debug("Updating region table with Id: "+region_id); + pstmt = conn.prepareStatement("update `cloud`.`region` set id = ?"); + pstmt.setInt(1, region_id); + pstmt.executeUpdate(); + + //Update regionId in account table + s_logger.debug("Updating account table with Id: "+region_id); + pstmt = conn.prepareStatement("update `cloud`.`account` set region_id = ?"); + pstmt.setInt(1, region_id); + pstmt.executeUpdate(); + + //Update regionId in user table + s_logger.debug("Updating user table with Id: "+region_id); + pstmt = conn.prepareStatement("update `cloud`.`user` set region_id = ?"); + pstmt.setInt(1, region_id); + pstmt.executeUpdate(); + + //Update regionId in domain table + s_logger.debug("Updating domain table with Id: "+region_id); + pstmt = conn.prepareStatement("update `cloud`.`domain` set region_id = ?"); + pstmt.setInt(1, region_id); + pstmt.executeUpdate(); + + //Update regionId in cloud_usage account table + s_logger.debug("Updating cloud_usage account table with Id: "+region_id); + pstmt = conn.prepareStatement("update `cloud_usage`.`account` set region_id = ?"); + pstmt.setInt(1, region_id); + pstmt.executeUpdate(); + s_logger.debug("Successfully updated region entries with regionId: "+region_id); + } catch (SQLException e) { + throw new CloudRuntimeException("Error while updating region entries", e); + } finally { + try { + if (pstmt != null) { + pstmt.close(); + } + } catch (SQLException e) { + } + } + } private void upgradeEIPNetworkOfferings(Connection conn) { PreparedStatement pstmt = null; diff --git a/setup/db/db/schema-40to410.sql b/setup/db/db/schema-40to410.sql index 6b59f685d25..f3124dd7ee5 100644 --- a/setup/db/db/schema-40to410.sql +++ b/setup/db/db/schema-40to410.sql @@ -260,7 +260,8 @@ CREATE TABLE `cloud`.`region` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- INSERT INTO `cloud`.`region` values ('1','Local','http://localhost:8080/client/api','',''); +INSERT INTO `cloud`.`region` values ('1','Local','http://localhost:8080/client/api','',''); + ALTER TABLE `cloud`.`account` ADD COLUMN `region_id` int unsigned NOT NULL DEFAULT '1'; ALTER TABLE `cloud`.`user` ADD COLUMN `region_id` int unsigned NOT NULL DEFAULT '1'; ALTER TABLE `cloud`.`domain` ADD COLUMN `region_id` int unsigned NOT NULL DEFAULT '1'; From 673700a1a2f0a8b04f5b4bf75564bf479b1fb0bf Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Thu, 28 Feb 2013 15:58:04 +0530 Subject: [PATCH 17/35] CLOUDSTACK-1340: Fix raw disk export using vbox internalcommand Signed-off-by: Rohit Yadav --- tools/appliance/build.sh | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh index 4d9d8bd19dd..b757dedae61 100644 --- a/tools/appliance/build.sh +++ b/tools/appliance/build.sh @@ -41,6 +41,7 @@ done # Get appliance uuids machine_uuid=`vboxmanage showvminfo $appliance | grep UUID | head -1 | awk '{print $2}'` hdd_uuid=`vboxmanage showvminfo $appliance | grep vdi | head -1 | awk '{print $8}' | cut -d ')' -f 1` +hdd_path=`vboxmanage list hdds | grep $appliance | grep vdi | cut -c 14-` # Compact the virtual hdd vboxmanage modifyhd $hdd_uuid --compact @@ -49,6 +50,19 @@ vboxmanage modifyhd $hdd_uuid --compact rm -fr dist mkdir dist +# Export for Xen +vboxmange internalcommands converttoraw $hdd_path dist/raw.img +vhd-util convert -s 0 -t 1 -i dist/raw.img -o dist/$appliance-$build_date-$branch-xen.vhd +bzip2 dist/$appliance-$build_date-$branch-xen.vhd +echo "$appliance exported for Xen: dist/$appliance-$build_date-$branch-xen.vhd.bz2" + +# Export for KVM +vboxmange internalcommands converttoraw $hdd_path dist/raw.img +qemu-img convert -f raw -O qcow2 dist/raw.img dist/$appliance-$build_date-$branch-kvm.qcow2 +rm dist/raw.img +bzip2 dist/$appliance-$build_date-$branch-kvm.qcow2 +echo "$appliance exported for KVM: dist/$appliance-$build_date-$branch-kvm.qcow2.bz2" + # Export for VMWare vSphere vboxmanage export $machine_uuid --output dist/$appliance-$build_date-$branch-vmware.ova echo "$appliance exported for VMWare: dist/$appliance-$build_date-$branch-vmware.ova" @@ -58,15 +72,3 @@ vboxmanage clonehd $hdd_uuid dist/$appliance-$build_date-$branch-hyperv.vhd --fo bzip2 dist/$appliance-$build_date-$branch-hyperv.vhd echo "$appliance exported for HyperV: dist/$appliance-$build_date-$branch-hyperv.vhd.bz2" -# Export for KVM -vboxmanage clonehd $hdd_uuid dist/raw.img --format RAW -qemu-img convert -f raw -O qcow2 dist/raw.img dist/$appliance-$build_date-$branch-kvm.qcow2 -bzip2 dist/$appliance-$build_date-$branch-kvm.qcow2 -echo "$appliance exported for KVM: dist/$appliance-$build_date-$branch-kvm.qcow2.bz2" - -# Export for Xen -# This will be an overwrite convert so, do it at the end -vhd-util convert -s 0 -t 1 -i dist/raw.img -o dist/$appliance-$build_date-$branch-xen.vhd -bzip2 dist/$appliance-$build_date-$branch-xen.vhd -echo "$appliance exported for Xen: dist/$appliance-$build_date-$branch-xen.vhd.bz2" - From 6380e2004c00c223947e08ba32d74f41a0b24340 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Thu, 28 Feb 2013 16:02:44 +0530 Subject: [PATCH 18/35] CLOUDSTACK-1340: apt-get autoclean and then clean to remove cached debs Signed-off-by: Rohit Yadav --- tools/appliance/definitions/systemvmtemplate/cleanup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/appliance/definitions/systemvmtemplate/cleanup.sh b/tools/appliance/definitions/systemvmtemplate/cleanup.sh index c6a1e9068d6..9e98ab03531 100644 --- a/tools/appliance/definitions/systemvmtemplate/cleanup.sh +++ b/tools/appliance/definitions/systemvmtemplate/cleanup.sh @@ -2,6 +2,7 @@ #apt-get -y remove linux-headers-$(uname -r) build-essential apt-get -y remove dictionaries-common busybox apt-get -y autoremove +apt-get autoclean apt-get clean # Removing leftover leases and persistent rules From 80a6aaf7e1b398de5e897e7a56845c7aa8f6c53f Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Thu, 28 Feb 2013 16:11:31 +0530 Subject: [PATCH 19/35] CLOUDSTACK-1340: Fix locale, cmd, disk size and remove multiple apt-get installs Signed-off-by: Rohit Yadav --- tools/appliance/build.sh | 4 ++-- .../definitions/systemvmtemplate/definition.rb | 2 +- .../definitions/systemvmtemplate/postinstall.sh | 13 ++++++++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh index b757dedae61..60b43bd5097 100644 --- a/tools/appliance/build.sh +++ b/tools/appliance/build.sh @@ -51,13 +51,13 @@ rm -fr dist mkdir dist # Export for Xen -vboxmange internalcommands converttoraw $hdd_path dist/raw.img +vboxmanage internalcommands converttoraw $hdd_path dist/raw.img vhd-util convert -s 0 -t 1 -i dist/raw.img -o dist/$appliance-$build_date-$branch-xen.vhd bzip2 dist/$appliance-$build_date-$branch-xen.vhd echo "$appliance exported for Xen: dist/$appliance-$build_date-$branch-xen.vhd.bz2" # Export for KVM -vboxmange internalcommands converttoraw $hdd_path dist/raw.img +vboxmanage internalcommands converttoraw $hdd_path dist/raw.img qemu-img convert -f raw -O qcow2 dist/raw.img dist/$appliance-$build_date-$branch-kvm.qcow2 rm dist/raw.img bzip2 dist/$appliance-$build_date-$branch-kvm.qcow2 diff --git a/tools/appliance/definitions/systemvmtemplate/definition.rb b/tools/appliance/definitions/systemvmtemplate/definition.rb index df9589c12cf..a6be769deee 100644 --- a/tools/appliance/definitions/systemvmtemplate/definition.rb +++ b/tools/appliance/definitions/systemvmtemplate/definition.rb @@ -1,7 +1,7 @@ Veewee::Definition.declare({ :cpu_count => '1', :memory_size=> '256', - :disk_size => '2048', :disk_format => 'VDI', :hostiocache => 'off', + :disk_size => '2000', :disk_format => 'VDI', :hostiocache => 'off', :os_type_id => 'Debian', :iso_file => "debian-wheezy-DI-b4-i386-netinst.iso", :iso_src => "http://cdimage.debian.org/cdimage/wheezy_di_beta4/i386/iso-cd/debian-wheezy-DI-b4-i386-netinst.iso", diff --git a/tools/appliance/definitions/systemvmtemplate/postinstall.sh b/tools/appliance/definitions/systemvmtemplate/postinstall.sh index cbe2aab35ef..268379c1759 100644 --- a/tools/appliance/definitions/systemvmtemplate/postinstall.sh +++ b/tools/appliance/definitions/systemvmtemplate/postinstall.sh @@ -27,7 +27,7 @@ install_packages() { # Basic packages apt-get --no-install-recommends -q -y --force-yes install rsyslog logrotate cron chkconfig insserv net-tools ifupdown vim-tiny netbase iptables - apt-get --no-install-recommends -q -y --force-yes install openssh-server openssl grub-legacy e2fsprogs dhcp3-client dnsmasq tcpdump socat wget + apt-get --no-install-recommends -q -y --force-yes install openssh-server openssl grub-legacy e2fsprogs dhcp3-client tcpdump socat wget apt-get --no-install-recommends -q -y --force-yes install python bzip2 sed gawk diffutils grep gzip less tar telnet ftp rsync traceroute psmisc lsof procps monit inetutils-ping iputils-arping httping apt-get --no-install-recommends -q -y --force-yes install dnsutils zip unzip ethtool uuid file iproute acpid virt-what sudo @@ -127,11 +127,22 @@ fix_hostname() { sed -i '/127.0.1.1/d' /etc/hosts } +fix_locale() { + cat >> /etc/default/locale << EOF +LANG=en_US.UTF-8 +LC_ALL=en_US.UTF-8 +EOF + cat >> /etc/locale.gen << EOF +en_US.UTF-8 UTF-8 +EOF +} + do_fixes() { fix_nameserver fix_inittab fix_acpid fix_hostname + fix_locale } configure_apache2() { From 2081aa3100f6a664d65a2cc425dc014c555f3a6c Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Thu, 28 Feb 2013 16:54:39 +0530 Subject: [PATCH 20/35] CLOUDSTACK-658 - Adding Scalevm commands --- .../com/cloud/agent/api/ScaleVmAnswer.java | 12 +++ .../com/cloud/agent/api/ScaleVmCommand.java | 97 +++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 api/src/com/cloud/agent/api/ScaleVmAnswer.java create mode 100644 api/src/com/cloud/agent/api/ScaleVmCommand.java diff --git a/api/src/com/cloud/agent/api/ScaleVmAnswer.java b/api/src/com/cloud/agent/api/ScaleVmAnswer.java new file mode 100644 index 00000000000..9481e0b4c84 --- /dev/null +++ b/api/src/com/cloud/agent/api/ScaleVmAnswer.java @@ -0,0 +1,12 @@ +package com.cloud.agent.api; + +public class ScaleVmAnswer extends Answer { + + protected ScaleVmAnswer() { + } + + public ScaleVmAnswer(ScaleVmCommand cmd, boolean result, String detail) { + super(cmd, result, detail); + } + +} diff --git a/api/src/com/cloud/agent/api/ScaleVmCommand.java b/api/src/com/cloud/agent/api/ScaleVmCommand.java new file mode 100644 index 00000000000..41db206fb0a --- /dev/null +++ b/api/src/com/cloud/agent/api/ScaleVmCommand.java @@ -0,0 +1,97 @@ +package com.cloud.agent.api; + +import com.cloud.agent.api.to.VirtualMachineTO; + +public class ScaleVmCommand extends Command { + + VirtualMachineTO vm; + String vmName; + int cpus; + Integer speed; + long minRam; + long maxRam; + + public VirtualMachineTO getVm() { + return vm; + } + + public void setVm(VirtualMachineTO vm) { + this.vm = vm; + } + + public int getCpus() { + return cpus; + } + + public ScaleVmCommand(String vmName, int cpus, + Integer speed, long minRam, long maxRam) { + super(); + this.vmName = vmName; + this.cpus = cpus; + //this.speed = speed; + this.minRam = minRam; + this.maxRam = maxRam; + this.vm = new VirtualMachineTO(1L, vmName, null, cpus, null, minRam, maxRam, null, null, false, false, null); + /*vm.setName(vmName); + vm.setCpus(cpus); + vm.setRam(minRam, maxRam);*/ + } + + public void setCpus(int cpus) { + this.cpus = cpus; + } + + public Integer getSpeed() { + return speed; + } + + public void setSpeed(Integer speed) { + this.speed = speed; + } + + public long getMinRam() { + return minRam; + } + + public void setMinRam(long minRam) { + this.minRam = minRam; + } + + public long getMaxRam() { + return maxRam; + } + + public void setMaxRam(long maxRam) { + this.maxRam = maxRam; + } + + public String getVmName() { + return vmName; + } + + public void setVmName(String vmName) { + this.vmName = vmName; + } + + public VirtualMachineTO getVirtualMachine() { + return vm; + } + + @Override + public boolean executeInSequence() { + return true; + } + + protected ScaleVmCommand() { + } + + public ScaleVmCommand(VirtualMachineTO vm) { + this.vm = vm; + } + + public boolean getLimitCpuUse() { + // TODO Auto-generated method stub + return false; + } + +} From 44f345e4c67a2c87c9b4c97fb800a6beefb3bf50 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Thu, 28 Feb 2013 16:54:45 +0530 Subject: [PATCH 21/35] CLOUDSTACK-1340: Fix destination path issue, vbox's internalcommands issue Signed-off-by: Rohit Yadav --- tools/appliance/build.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh index 60b43bd5097..039369be81c 100644 --- a/tools/appliance/build.sh +++ b/tools/appliance/build.sh @@ -49,26 +49,27 @@ vboxmanage modifyhd $hdd_uuid --compact # Start exporting rm -fr dist mkdir dist +cd dist # Export for Xen -vboxmanage internalcommands converttoraw $hdd_path dist/raw.img -vhd-util convert -s 0 -t 1 -i dist/raw.img -o dist/$appliance-$build_date-$branch-xen.vhd -bzip2 dist/$appliance-$build_date-$branch-xen.vhd +vboxmanage internalcommands converttoraw "$hdd_path" raw.img +vhd-util convert -s 0 -t 1 -i raw.img -o $appliance-$build_date-$branch-xen.vhd +bzip2 $appliance-$build_date-$branch-xen.vhd echo "$appliance exported for Xen: dist/$appliance-$build_date-$branch-xen.vhd.bz2" # Export for KVM -vboxmanage internalcommands converttoraw $hdd_path dist/raw.img -qemu-img convert -f raw -O qcow2 dist/raw.img dist/$appliance-$build_date-$branch-kvm.qcow2 -rm dist/raw.img -bzip2 dist/$appliance-$build_date-$branch-kvm.qcow2 +vboxmanage internalcommands converttoraw "$hdd_path" raw.img +qemu-img convert -f raw -O qcow2 raw.img $appliance-$build_date-$branch-kvm.qcow2 +rm raw.img +bzip2 $appliance-$build_date-$branch-kvm.qcow2 echo "$appliance exported for KVM: dist/$appliance-$build_date-$branch-kvm.qcow2.bz2" # Export for VMWare vSphere -vboxmanage export $machine_uuid --output dist/$appliance-$build_date-$branch-vmware.ova +vboxmanage export $machine_uuid --output $appliance-$build_date-$branch-vmware.ova echo "$appliance exported for VMWare: dist/$appliance-$build_date-$branch-vmware.ova" # Export for HyperV -vboxmanage clonehd $hdd_uuid dist/$appliance-$build_date-$branch-hyperv.vhd --format VHD -bzip2 dist/$appliance-$build_date-$branch-hyperv.vhd +vboxmanage clonehd $hdd_uuid $appliance-$build_date-$branch-hyperv.vhd --format VHD +bzip2 $appliance-$build_date-$branch-hyperv.vhd echo "$appliance exported for HyperV: dist/$appliance-$build_date-$branch-hyperv.vhd.bz2" From 54bfd7e04a0ab8c613aba3fcb2dd7e112cb35b31 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Thu, 28 Feb 2013 17:28:15 +0530 Subject: [PATCH 22/35] orchestration: Fix VirtualMachineEntityFactory to process spring injections The bug was found was Harikrishna P. when iso was used, in case of Isos, the create vm from scratch which fails due to factory being used to get the object which is not spring injected Signed-off-by: Rohit Yadav --- .../engine/cloud/entity/api/VirtualMachineEntityFactory.java | 3 ++- .../cloudstack/platform/orchestration/CloudOrchestrator.java | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityFactory.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityFactory.java index 2e8638eec07..e8ad8e47745 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityFactory.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityFactory.java @@ -16,6 +16,7 @@ // under the License. package org.apache.cloudstack.engine.cloud.entity.api; +import com.cloud.utils.component.ComponentContext; import org.springframework.beans.factory.FactoryBean; import org.springframework.stereotype.Component; @@ -24,7 +25,7 @@ public class VirtualMachineEntityFactory implements FactoryBean Date: Thu, 28 Feb 2013 17:37:02 +0530 Subject: [PATCH 23/35] CLOUDSTACK-1340: Jenkins fails for changing directories, rvm sourcing fails http://jenkins.cloudstack.org/job/build-systemvm-master/64/console Signed-off-by: Rohit Yadav --- tools/appliance/build.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh index 039369be81c..f0ac377a62b 100644 --- a/tools/appliance/build.sh +++ b/tools/appliance/build.sh @@ -47,9 +47,8 @@ hdd_path=`vboxmanage list hdds | grep $appliance | grep vdi | cut -c 14-` vboxmanage modifyhd $hdd_uuid --compact # Start exporting -rm -fr dist +rm -fr dist *.ova *.vhd *.vdi *.qcow* *.bz2 mkdir dist -cd dist # Export for Xen vboxmanage internalcommands converttoraw "$hdd_path" raw.img @@ -73,3 +72,5 @@ vboxmanage clonehd $hdd_uuid $appliance-$build_date-$branch-hyperv.vhd --format bzip2 $appliance-$build_date-$branch-hyperv.vhd echo "$appliance exported for HyperV: dist/$appliance-$build_date-$branch-hyperv.vhd.bz2" +mv *.bz2 *.ova dist/ + From 4446b9dff63988d794cd99dd5711014234fff81e Mon Sep 17 00:00:00 2001 From: Radhika PC Date: Thu, 28 Feb 2013 18:10:42 +0530 Subject: [PATCH 24/35] CLOUDSTACK-1221 --- docs/en-US/vlan-provisioning.xml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/docs/en-US/vlan-provisioning.xml b/docs/en-US/vlan-provisioning.xml index 8abd5da0a75..9345647d47a 100644 --- a/docs/en-US/vlan-provisioning.xml +++ b/docs/en-US/vlan-provisioning.xml @@ -21,10 +21,23 @@ specific language governing permissions and limitations under the License. --> -
- VLAN Provisioning - &PRODUCT; automatically creates and destroys interfaces bridged to VLANs on the hosts. In general the administrator does not need to manage this process. - &PRODUCT; manages VLANs differently based on hypervisor type. For XenServer or KVM, the VLANs are created on only the hosts where they will be used and then they are destroyed when all guests that require them have been terminated or moved to another host. - For vSphere the VLANs are provisioned on all hosts in the cluster even if there is no guest running on a particular Host that requires the VLAN. This allows the administrator to perform live migration and other functions in vCenter without having to create the VLAN on the destination Host. Additionally, the VLANs are not removed from the Hosts when they are no longer needed. + VLAN Provisioning + &PRODUCT; automatically creates and destroys interfaces bridged to VLANs on the hosts. In + general the administrator does not need to manage this process. + &PRODUCT; manages VLANs differently based on hypervisor type. For XenServer or KVM, the + VLANs are created on only the hosts where they will be used and then they are destroyed when all + guests that require them have been terminated or moved to another host. + For vSphere the VLANs are provisioned on all hosts in the cluster even if there is no guest + running on a particular Host that requires the VLAN. This allows the administrator to perform + live migration and other functions in vCenter without having to create the VLAN on the + destination Host. Additionally, the VLANs are not removed from the Hosts when they are no longer + needed. + You can use the same VLANs on different physical networks provided that each physical + network has its own underlying layer-2 infrastructure, such as switches. For example, you can + specify VLAN range 500 to 1000 while deploying physical networks A and B in an Advanced zone + setup. This capability allows you to set up an additional layer-2 physical infrastructure on a + different physical NIC and use the same set of VLANs if you run out of VLANs. Another advantage + is that you can use the same set of IPs for different customers, each one with their own routers + and the guest networks on different physical NICs.
From ca6c1eba9cae53944faa29e80b13ccd81cd9ed68 Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Thu, 28 Feb 2013 12:56:46 +0100 Subject: [PATCH 25/35] debian: Require either Java 6 or 7 Our source is 1.6 compatible (pom.xml), but users can choose to compile with JDK7 and run with JRE 7 if they want. --- debian/control | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/control b/debian/control index 659084c38ae..98a390f1402 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: cloudstack Section: libs Priority: extra Maintainer: Wido den Hollander -Build-Depends: debhelper (>= 7), openjdk-6-jdk, tomcat6, genisoimage, +Build-Depends: debhelper (>= 7), openjdk-6-jdk | openjdk-7-jdk, tomcat6, genisoimage, python-mysqldb, maven3 | maven (>= 3), python (>= 2.6.6-3~) Standards-Version: 3.8.1 Homepage: http://www.cloudstack.org/ @@ -22,7 +22,7 @@ Description: CloudStack server library Package: cloudstack-agent Architecture: all -Depends: openjdk-6-jre, cloudstack-common (= ${source:Version}), lsb-base (>= 3.2), openssh-client, libvirt0, sysvinit-utils, chkconfig, qemu-kvm, libvirt-bin, uuid-runtime, rsync, grep, iproute, ebtables, vlan, wget, jsvc +Depends: openjdk-6-jre | openjdk-7-jre, cloudstack-common (= ${source:Version}), lsb-base (>= 3.2), openssh-client, libvirt0, sysvinit-utils, chkconfig, qemu-kvm, libvirt-bin, uuid-runtime, rsync, grep, iproute, ebtables, vlan, wget, jsvc Conflicts: cloud-agent, cloud-agent-libs, cloud-agent-deps, cloud-agent-scripts Description: CloudStack agent The CloudStack agent is in charge of managing shared computing resources in @@ -31,7 +31,7 @@ Description: CloudStack agent Package: cloudstack-usage Architecture: all -Depends: openjdk-6-jre, cloudstack-common (= ${source:Version}), jsvc +Depends: openjdk-6-jre | openjdk-7-jre, cloudstack-common (= ${source:Version}), jsvc Description: CloudStack usage monitor The CloudStack usage monitor provides usage accounting across the entire cloud for cloud operators to charge based on usage parameters. From 01db2df23eb1edd7b78bc70cacf0886a783a4d28 Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Thu, 28 Feb 2013 12:57:35 +0100 Subject: [PATCH 26/35] debian: Copy the 4.2 jar files to the destination directories. This is FAR from perfect, but it works for now. the VERSION variable returns 4.1 from the debian/changelog file, but in the Maven configuration everything is already set to 4.2 So generated JAR files have 4.2.XX-SNAPSHOT in their name. We probably want to find a better way to match this, extracting the version somewhere out of Maven maybe? --- debian/rules | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/debian/rules b/debian/rules index d537d86204b..d4002f37985 100755 --- a/debian/rules +++ b/debian/rules @@ -60,7 +60,7 @@ install: # cloudstack-agent mkdir debian/tmp/etc/cloud/agent mkdir debian/tmp/var/log/cloudstack/agent - install -D plugins/hypervisors/kvm/target/cloud-plugin-hypervisor-kvm-4.1.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-agent/lib/cloudstack-agent-kvm.jar + install -D plugins/hypervisors/kvm/target/cloud-plugin-hypervisor-kvm-4.2.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-agent/lib/cloudstack-agent-kvm.jar install -D packaging/debian/init/cloud-agent debian/tmp/etc/init.d/ install -D agent/bindir/cloud-setup-agent.in debian/tmp/usr/bin/cloud-setup-agent install -D agent/bindir/cloud-ssh.in debian/tmp/usr/bin/cloud-ssh @@ -80,14 +80,14 @@ install: mkdir debian/tmp/var/lib/cloud/management mkdir debian/tmp/var/lib/cloud/mnt cp -r client/target/utilities/scripts/db/* debian/tmp/usr/share/cloudstack-management/setup/ - cp -r client/target/cloud-client-ui-4.1.0-SNAPSHOT/* debian/tmp/usr/share/cloudstack-management/webapps/client/ + cp -r client/target/cloud-client-ui-4.2.0-SNAPSHOT/* debian/tmp/usr/share/cloudstack-management/webapps/client/ cp server/target/conf/* debian/tmp/etc/cloud/server/ cp client/target/conf/* debian/tmp/etc/cloud/management/ ln -s tomcat6-nonssl.conf debian/tmp/etc/cloud/management/tomcat6.conf mkdir -p debian/tmp/etc/cloud/management/Catalina/localhost/client install -D packaging/debian/init/cloud-management debian/tmp/etc/init.d/cloud-management install -D client/bindir/cloud-update-xenserver-licenses.in debian/tmp/usr/bin/cloud-update-xenserver-licenses - install -D server/target/cloud-server-4.1.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-management/lib/cloudstack-server.jar + install -D server/target/cloud-server-4.2.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-management/lib/cloudstack-server.jar ln -s /usr/share/tomcat6/bin debian/tmp/usr/share/cloudstack-management/bin ln -s ../../../etc/cloud/management debian/tmp/usr/share/cloudstack-management/conf ln -s /usr/share/tomcat6/lib debian/tmp/usr/share/cloudstack-management/lib @@ -109,9 +109,9 @@ install: install -D client/target/utilities/bin/cloud-set-guest-sshkey debian/tmp/usr/bin install -D client/target/utilities/bin/cloud-setup-databases debian/tmp/usr/bin install -D client/target/utilities/bin/cloud-setup-management debian/tmp/usr/bin - install -D console-proxy/dist/systemvm.iso debian/tmp/usr/share/cloudstack-common/vms/systemvm.iso - install -D core/target/cloud-core-4.1.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-common/lib/cloudstack-core.jar - install -D api/target/cloud-api-4.1.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-common/lib/cloudstack-api.jar + install -D services/console-proxy/server/dist/systemvm.iso debian/tmp/usr/share/cloudstack-common/vms/systemvm.iso + install -D core/target/cloud-core-4.2.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-common/lib/cloudstack-core.jar + install -D api/target/cloud-api-4.2.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-common/lib/cloudstack-api.jar # cloudstack-python mkdir -p debian/tmp/usr/lib/python2.7/dist-packages @@ -120,7 +120,7 @@ install: # cloudstack-usage mkdir debian/tmp/etc/cloud/usage mkdir debian/tmp/var/log/cloudstack/usage - install -D usage/target/cloud-usage-4.1.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-usage/lib/cloudstack-usage.jar + install -D usage/target/cloud-usage-4.2.0-SNAPSHOT.jar debian/tmp/usr/share/cloudstack-usage/lib/cloudstack-usage.jar cp usage/target/transformed/* debian/tmp/etc/cloud/usage/ ln -s ../management/db.properties debian/tmp/etc/cloud/usage/db.properties install -D packaging/debian/init/cloud-usage debian/tmp/etc/init.d From f16347960aa8c4472ee59b1671c1000bd8b7836c Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Thu, 28 Feb 2013 18:34:34 +0530 Subject: [PATCH 27/35] rat: Fix the license, the mouse is squeaking, Nitin stepped on it :) Signed-off-by: Rohit Yadav --- api/src/com/cloud/agent/api/ScaleVmAnswer.java | 16 ++++++++++++++++ api/src/com/cloud/agent/api/ScaleVmCommand.java | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/api/src/com/cloud/agent/api/ScaleVmAnswer.java b/api/src/com/cloud/agent/api/ScaleVmAnswer.java index 9481e0b4c84..31d6e44155f 100644 --- a/api/src/com/cloud/agent/api/ScaleVmAnswer.java +++ b/api/src/com/cloud/agent/api/ScaleVmAnswer.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.agent.api; public class ScaleVmAnswer extends Answer { diff --git a/api/src/com/cloud/agent/api/ScaleVmCommand.java b/api/src/com/cloud/agent/api/ScaleVmCommand.java index 41db206fb0a..e5078d5e8c0 100644 --- a/api/src/com/cloud/agent/api/ScaleVmCommand.java +++ b/api/src/com/cloud/agent/api/ScaleVmCommand.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.agent.api; import com.cloud.agent.api.to.VirtualMachineTO; From 9801667199f171f4c5b33c7ebd7765c737cc6337 Mon Sep 17 00:00:00 2001 From: Noa Resare Date: Thu, 28 Feb 2013 13:16:16 +0000 Subject: [PATCH 28/35] Revert classpath.conf.in to before .deb packaing merge This change is apparently incompatible with the centos packaging, temporarily reverting until we have discussed a proper fix CLOUDSTACK-1436: 4.1 management server fails to start from RPM... CLOUDSTACK-1423: Unable to launch UI [HTTP Status 404 - ] Signed-off-by: David Nalley --- client/tomcatconf/classpath.conf.in | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/client/tomcatconf/classpath.conf.in b/client/tomcatconf/classpath.conf.in index 5625f69ed33..3ae0fb4d778 100644 --- a/client/tomcatconf/classpath.conf.in +++ b/client/tomcatconf/classpath.conf.in @@ -16,11 +16,23 @@ # specific language governing permissions and limitations # under the License. -# We use WEB-INF/lib in the webapp for including things into -# the classpath nowdays - -for jar in /usr/share/tomcat6/lib/*.jar; do - CLASSPATH=$jar:$CLASSPATH +SYSTEMJARS="@SYSTEMJARS@" +SCP=$(build-classpath $SYSTEMJARS 2>/dev/null) ; if [ $? != 0 ] ; then export SCP="@SYSTEMCLASSPATH@" ; fi +MCP="@MSCLASSPATH@" +DCP="@DEPSCLASSPATH@" +CLASSPATH=$SCP:$DCP:$MCP:@MSCONF@:@SETUPDATADIR@ +for jarfile in "@PREMIUMJAVADIR@"/* ; do + if [ ! -e "$jarfile" ] ; then continue ; fi + CLASSPATH=$jarfile:$CLASSPATH +done +for plugin in "@PLUGINJAVADIR@"/* ; do + if [ ! -e "$plugin" ] ; then continue ; fi + CLASSPATH=$plugin:$CLASSPATH +done +for vendorconf in "@MSCONF@"/vendor/* ; do + if [ ! -d "$vendorconf" ] ; then continue ; fi + CLASSPATH=$vendorconf:$CLASSPATH done -CLASSPATH=${CLASSPATH}/usr/share/cloudstack-management/webapps/client/WEB-INF/lib/mysql-connector-java-5.1.21.jar export CLASSPATH +PATH=/sbin:/usr/sbin:$PATH +export PATH From 5477d096d5b0e1c318d4a5793f9153b912e146ac Mon Sep 17 00:00:00 2001 From: Noa Resare Date: Thu, 28 Feb 2013 15:20:03 +0100 Subject: [PATCH 29/35] rpm packaging fix: Add symlink for log4j-cloud.xml in client webapp web.xml now references a log4j-cloud.xml relative to the webapp root to capture early logging from spring. This change introduces a symlink in the client webapp to the system wide log4j-cloud.xml which works around a problem starting cloud-management described in CLOUDSTACK-1436 CLOUDSTACK-1436: 4.1 management server fails to start from RPM... CLOUDSTACK-1423: Unable to launch UI [HTTP Status 404 - ] Signed-off-by: David Nalley --- packaging/centos63/cloud.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packaging/centos63/cloud.spec b/packaging/centos63/cloud.spec index e345679addf..ab71d0ffea7 100644 --- a/packaging/centos63/cloud.spec +++ b/packaging/centos63/cloud.spec @@ -227,6 +227,10 @@ for name in db.properties log4j-cloud.xml tomcat6-nonssl.conf tomcat6-ssl.conf s mv ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/webapps/client/WEB-INF/classes/$name \ ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/$name done + +ln -s %{_sysconfdir}/%{name}/management/log4j-cloud.xml \ + ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/webapps/client/WEB-INF/classes/log4j-cloud.xml + mv ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/webapps/client/WEB-INF/classes/context.xml \ ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/Catalina/localhost/client From 3f876060c0b1c62a8f36be494891141fc8620fa0 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 27 Feb 2013 11:59:38 -0800 Subject: [PATCH 30/35] CLOUDSTACK-452: cloudstack UI - Infrastructure menu - zone detail - physical network - guest network - add IPv6 CIDR, IPv6 Gateway to listView and detailView. --- ui/scripts/system.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index d5c2a4c1022..ce2d7371da7 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -1104,8 +1104,9 @@ name: { label: 'label.name' }, type: { label: 'label.type' }, vlan: { label: 'label.vlan.id' }, - cidr: { label: 'label.cidr' }, - scope: { label: 'label.scope' } + cidr: { label: 'IPv4 CIDR' }, + ip6cidr: { label: 'IPv6 CIDR'} + //scope: { label: 'label.scope' } }, actions: { add: { @@ -1841,9 +1842,13 @@ label: 'label.network.offering.id' }, - gateway: { label: 'label.gateway' }, + gateway: { label: 'IPv4 Gateway' }, //netmask: { label: 'label.netmask' }, - cidr: { label: 'label.cidr' }, + cidr: { label: 'IPv4 CIDR' }, + + ip6gateway: { label: 'IPv6 Gateway' }, + ip6cidr: { label: 'IPv6 CIDR' }, + networkdomaintext: { label: 'label.network.domain' }, From 5dd44b0dde1e0e052f793cedd9f3b23f6092adeb Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 27 Feb 2013 16:12:59 -0800 Subject: [PATCH 31/35] CLOUDSTACK-452: cloudstack UI - Infrastructure menu - zone detail - physical network - create guest network - add IPv6 Gateway, IPv6 CIDR, IPv6 Start IP, IPv6 End IP field. --- ui/scripts/system.js | 103 +++++++++++++++++++++++++++++-------------- 1 file changed, 69 insertions(+), 34 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index ce2d7371da7..7081d1bc12b 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -1353,12 +1353,12 @@ if(this.id == selectedNetworkOfferingId) { if(this.guestiptype == "Isolated") { //*** Isolated *** if(this.specifyipranges == false) { - $form.find('.form-item[rel=guestStartIp]').hide(); - $form.find('.form-item[rel=guestEndIp]').hide(); + $form.find('.form-item[rel=startipv4]').hide(); + $form.find('.form-item[rel=endipv4]').hide(); } else { - $form.find('.form-item[rel=guestStartIp]').css('display', 'inline-block'); - $form.find('.form-item[rel=guestEndIp]').css('display', 'inline-block'); + $form.find('.form-item[rel=startipv4]').css('display', 'inline-block'); + $form.find('.form-item[rel=endipv4]').css('display', 'inline-block'); } var includingSourceNat = false; @@ -1370,20 +1370,20 @@ } } if(includingSourceNat == true) { //Isolated with SourceNat - cloudStack.dialog.createFormField.validation.required.remove($form.find('.form-item[rel=guestGateway]')); //make guestGateway optional - cloudStack.dialog.createFormField.validation.required.remove($form.find('.form-item[rel=guestNetmask]')); //make guestNetmask optional + cloudStack.dialog.createFormField.validation.required.remove($form.find('.form-item[rel=ip4gateway]')); //make ip4gateway optional + cloudStack.dialog.createFormField.validation.required.remove($form.find('.form-item[rel=ip4Netmask]')); //make ip4Netmask optional } else { //Isolated with no SourceNat - cloudStack.dialog.createFormField.validation.required.add($form.find('.form-item[rel=guestGateway]')); //make guestGateway required - cloudStack.dialog.createFormField.validation.required.add($form.find('.form-item[rel=guestNetmask]')); //make guestNetmask required + cloudStack.dialog.createFormField.validation.required.add($form.find('.form-item[rel=ip4gateway]')); //make ip4gateway required + cloudStack.dialog.createFormField.validation.required.add($form.find('.form-item[rel=ip4Netmask]')); //make ip4Netmask required } } else { //*** Shared *** - $form.find('.form-item[rel=guestStartIp]').css('display', 'inline-block'); - $form.find('.form-item[rel=guestEndIp]').css('display', 'inline-block'); + $form.find('.form-item[rel=startipv4]').css('display', 'inline-block'); + $form.find('.form-item[rel=endipv4]').css('display', 'inline-block'); - cloudStack.dialog.createFormField.validation.required.add($form.find('.form-item[rel=guestGateway]')); //make guestGateway required - cloudStack.dialog.createFormField.validation.required.add($form.find('.form-item[rel=guestNetmask]')); //make guestNetmask required + cloudStack.dialog.createFormField.validation.required.add($form.find('.form-item[rel=ip4gateway]')); //make ip4gateway required + cloudStack.dialog.createFormField.validation.required.add($form.find('.form-item[rel=ip4Netmask]')); //make ip4Netmask required } if(this.specifyvlan == false) { @@ -1401,24 +1401,47 @@ } }, - guestGateway: { - label: 'label.guest.gateway', + //IPv4 (begin) + ip4gateway: { + label: 'IPv4 Gateway', docID: 'helpGuestNetworkZoneGateway' }, - guestNetmask: { - label: 'label.guest.netmask', + ip4Netmask: { + label: 'IPv4 Netmask', docID: 'helpGuestNetworkZoneNetmask' }, - guestStartIp: { - label: 'label.guest.start.ip', - validation: { required: true }, + startipv4: { + label: 'IPv4 Start IP', + validation: { required: true }, docID: 'helpGuestNetworkZoneStartIP' - }, - guestEndIp: { - label: 'label.guest.end.ip', - validation: { required: true }, + }, + endipv4: { + label: 'IPv4 End IP', + validation: { required: true }, docID: 'helpGuestNetworkZoneEndIP' - }, + }, + //IPv4 (end) + + //IPv6 (begin) + ip6gateway: { + label: 'IPv6 Gateway', + docID: 'helpGuestNetworkZoneGateway' + }, + ip6cidr: { + label: 'IPv6 CIDR' + }, + startipv6: { + label: 'IPv6 Start IP', + validation: { required: true }, + docID: 'helpGuestNetworkZoneStartIP' + }, + endipv6: { + label: 'IPv6 End IP', + validation: { required: true }, + docID: 'helpGuestNetworkZoneEndIP' + }, + //IPv6 (end) + networkdomain: { label: 'label.network.domain', docID: 'helpGuestNetworkZoneNetworkDomain' @@ -1474,16 +1497,28 @@ array1.push("&acltype=domain"); //server-side will make it Root domain (i.e. domainid=1) } - if(args.data.guestGateway != null && args.data.guestGateway.length > 0) - array1.push("&gateway=" + args.data.guestGateway); - if(args.data.guestNetmask != null && args.data.guestNetmask.length > 0) - array1.push("&netmask=" + args.data.guestNetmask); - - if(($form.find('.form-item[rel=guestStartIp]').css("display") != "none") && (args.data.guestStartIp != null && args.data.guestStartIp.length > 0)) - array1.push("&startip=" + args.data.guestStartIp); - if(($form.find('.form-item[rel=guestEndIp]').css("display") != "none") && (args.data.guestEndIp != null && args.data.guestEndIp.length > 0)) - array1.push("&endip=" + args.data.guestEndIp); - + //IPv4 (begin) + if(args.data.ip4gateway != null && args.data.ip4gateway.length > 0) + array1.push("&gateway=" + args.data.ip4gateway); + if(args.data.ip4Netmask != null && args.data.ip4Netmask.length > 0) + array1.push("&netmask=" + args.data.ip4Netmask); + if(($form.find('.form-item[rel=startipv4]').css("display") != "none") && (args.data.startipv4 != null && args.data.startipv4.length > 0)) + array1.push("&startip=" + args.data.startipv4); + if(($form.find('.form-item[rel=endipv4]').css("display") != "none") && (args.data.endipv4 != null && args.data.endipv4.length > 0)) + array1.push("&endip=" + args.data.endipv4); + //IPv4 (end) + + //IPv6 (begin) + if(args.data.ip6gateway != null && args.data.ip6gateway.length > 0) + array1.push("&gateway=" + args.data.ip6gateway); + if(args.data.ip6cidr != null && args.data.ip6cidr.length > 0) + array1.push("&netmask=" + args.data.ip6cidr); + if(($form.find('.form-item[rel=startipv6]').css("display") != "none") && (args.data.startipv6 != null && args.data.startipv6.length > 0)) + array1.push("&startip=" + args.data.startipv6); + if(($form.find('.form-item[rel=endipv6]').css("display") != "none") && (args.data.endipv6 != null && args.data.endipv6.length > 0)) + array1.push("&endip=" + args.data.endipv6); + //IPv6 (end) + if(args.data.networkdomain != null && args.data.networkdomain.length > 0) array1.push("&networkdomain=" + todb(args.data.networkdomain)); From ac89c3e7e1ed3fbb5f207de8fdf1ebf6ba658836 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 27 Feb 2013 16:33:58 -0800 Subject: [PATCH 32/35] CLOUDSTACK-452: cloudstack UI - Infrastructure menu - zone detail - guest network - network detail - View IP Ranges (only available in Advanced zone) - add IPv6 Start IP, IPv6 End IP field to listView and Add IP Range dialog. --- ui/scripts/system.js | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 7081d1bc12b..2f105aff2ae 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -9946,8 +9946,10 @@ listView: { section: 'guest-IP-range', fields: { - startip: { label: 'label.start.IP' }, - endip: { label: 'label.end.IP' } + startip: { label: 'IPv4 Start IP' }, + endip: { label: 'IPv4 End IP' }, + startipv6: { label: 'IPv6 Start IP' }, + endipv6: { label: 'IPv6 End IP' } }, dataProvider: function(args) { @@ -9968,16 +9970,24 @@ createForm: { title: 'label.add.ip.range', fields: { - guestStartIp: { label: 'label.guest.start.ip' }, - guestEndIp: { label: 'label.guest.end.ip' } + startipv4: { label: 'IPv4 Start IP' }, + endipv4: { label: 'IPv4 End IP' }, + startipv6: { label: 'IPv6 Start IP' }, + endipv6: { label: 'IPv6 End IP' } } }, action: function(args) { var array2 = []; - array2.push("&startip=" + args.data.guestStartIp); - var endip = args.data.guestEndIp; - if(endip != null && endip.length > 0) - array2.push("&endip=" + endip); + if(args.data.startipv4 != null && args.data.startipv4.length > 0) + array2.push("&startip=" + args.data.startipv4); + if(args.data.endipv4 != null && args.data.endipv4.length > 0) + array2.push("&endip=" + args.data.endipv4); + + if(args.data.startipv6 != null && args.data.startipv6.length > 0) + array2.push("&startipv6=" + args.data.startipv6); + if(args.data.endipv6 != null && args.data.endipv6.length > 0) + array2.push("&endipv6=" + args.data.endipv6); + $.ajax({ url: createURL("createVlanIpRange&forVirtualNetwork=false&networkid=" + args.context.networks[0].id + array2.join("")), dataType: "json", From b1fcccc3f1a585482222f2c630d1c2fb9dde0622 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 28 Feb 2013 11:02:52 -0800 Subject: [PATCH 33/35] CLOUDSTACK-452: cloudstack UI - Zone Wizard - add IPv6 DNS1 field, IPv6 DNS2 field. --- ui/scripts/zoneWizard.js | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js index 883553ccbd4..d8684fb8e28 100755 --- a/ui/scripts/zoneWizard.js +++ b/ui/scripts/zoneWizard.js @@ -344,14 +344,24 @@ label: 'label.name', validation: { required: true }, desc: 'message.tooltip.zone.name' }, - dns1: { - label: 'label.dns.1', validation: { required: true }, + ip4dns1: { + label: 'IPv4 DNS1', validation: { required: true }, desc: 'message.tooltip.dns.1' }, - dns2: { - label: 'label.dns.2', + ip4dns2: { + label: 'IPv4 DNS2', desc: 'message.tooltip.dns.2' }, + + ip6dns1: { + label: 'IPv6 DNS1', + desc: 'message.tooltip.dns.1' + }, + ip6dns2: { + label: 'IPv6 DNS2', + desc: 'message.tooltip.dns.2' + }, + internaldns1: { label: 'label.internal.dns.1', validation: { required: true }, desc: 'message.tooltip.internal.dns.1' @@ -1494,11 +1504,19 @@ if (args.data.zone.localstorageenabled == 'on') { array1.push("&localstorageenabled=true"); } - array1.push("&dns1=" + todb(args.data.zone.dns1)); - - var dns2 = args.data.zone.dns2; - if (dns2 != null && dns2.length > 0) - array1.push("&dns2=" + todb(dns2)); + + //IPv4 + if (args.data.zone.ip4dns1 != null && args.data.zone.ip4dns1.length > 0) + array1.push("&dns1=" + todb(args.data.zone.ip4dns1)); + if (args.data.zone.ip4dns2 != null && args.data.zone.ip4dns2.length > 0) + array1.push("&dns2=" + todb(args.data.zone.ip4dns2)); + + //IPv6 + if (args.data.zone.ip6dns1 != null && args.data.zone.ip6dns1.length > 0) + array1.push("&ip6dns1=" + todb(args.data.zone.ip6dns1)); + if (args.data.zone.ip6dns2 != null && args.data.zone.ip6dns2.length > 0) + array1.push("&ip6dns2=" + todb(args.data.zone.ip6dns2)); + array1.push("&internaldns1="+todb(args.data.zone.internaldns1)); From 97ca7791b319d79578f5147844a694d1461270c4 Mon Sep 17 00:00:00 2001 From: Hugo Trippaers Date: Thu, 28 Feb 2013 21:28:46 +0100 Subject: [PATCH 34/35] Don't load from a fixed path, but load from the classpath so admins or packagers can overwrite the logging config --- client/WEB-INF/web.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/WEB-INF/web.xml b/client/WEB-INF/web.xml index 626305b82fa..da2f13c8cf7 100644 --- a/client/WEB-INF/web.xml +++ b/client/WEB-INF/web.xml @@ -22,7 +22,7 @@ log4jConfigLocation - /WEB-INF/classes/log4j-cloud.xml + classpath:log4j-cloud.xml org.springframework.web.util.Log4jConfigListener From 6f19895191edd0b9bc2ab2524f969afb9fc0a3b4 Mon Sep 17 00:00:00 2001 From: Min Chen Date: Thu, 28 Feb 2013 14:17:58 -0800 Subject: [PATCH 35/35] Remove unused RandomlyIncreasingVMInstanceDaoImpl to avoid confusion. Confirmed with Kishan about this. --- client/tomcatconf/componentContext.xml.in | 1 - .../tomcatconf/nonossComponentContext.xml.in | 1 - .../RandomlyIncreasingVMInstanceDaoImpl.java | 36 ------------------- 3 files changed, 38 deletions(-) delete mode 100644 server/src/com/cloud/vm/dao/RandomlyIncreasingVMInstanceDaoImpl.java diff --git a/client/tomcatconf/componentContext.xml.in b/client/tomcatconf/componentContext.xml.in index a09e8587d4d..87fc6f86ad8 100644 --- a/client/tomcatconf/componentContext.xml.in +++ b/client/tomcatconf/componentContext.xml.in @@ -48,7 +48,6 @@ - diff --git a/client/tomcatconf/nonossComponentContext.xml.in b/client/tomcatconf/nonossComponentContext.xml.in index ba618756c69..ac77ab721b2 100644 --- a/client/tomcatconf/nonossComponentContext.xml.in +++ b/client/tomcatconf/nonossComponentContext.xml.in @@ -49,7 +49,6 @@ - diff --git a/server/src/com/cloud/vm/dao/RandomlyIncreasingVMInstanceDaoImpl.java b/server/src/com/cloud/vm/dao/RandomlyIncreasingVMInstanceDaoImpl.java deleted file mode 100644 index cc5c5368a81..00000000000 --- a/server/src/com/cloud/vm/dao/RandomlyIncreasingVMInstanceDaoImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package com.cloud.vm.dao; - - -import javax.ejb.Local; - -import org.apache.log4j.Logger; -import org.springframework.context.annotation.Primary; -import org.springframework.stereotype.Component; - -@Local(value = { UserVmDao.class }) -public class RandomlyIncreasingVMInstanceDaoImpl extends UserVmDaoImpl { - - public static final Logger s_logger = Logger.getLogger(RandomlyIncreasingVMInstanceDaoImpl.class); - - @Override - public K getNextInSequence(final Class clazz, final String name) { - return getRandomlyIncreasingNextInSequence(clazz, name); - } - -}