Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1bbcefd
odim 317:Adding the dell plugin base code
jeevan-kamkar Jan 15, 2021
cdc7c9f
odim 317:Updating the github actions
jeevan-kamkar Jan 15, 2021
51adeed
Improved docker configuration for Dell plugin
Apr 1, 2021
7b1c953
Updated numerous functions for dell plugin
May 27, 2021
8944ee3
Merge branch 'development' of https://github.com/ODIM-Project/ODIM in…
Jun 29, 2021
e4d3404
Merge branch 'development' of https://github.com/ODIM-Project/ODIM in…
Jul 22, 2021
3ebbb20
Cleanup
Jul 22, 2021
205bf22
Merge branch 'development' into mmis-dell-storage
bharath-b-hpe Jul 26, 2021
42f5615
Fixed Volume tests
Aug 13, 2021
74565f9
Merge branch 'mmis-dell-storage' of https://github.com/ODIM-Project/O…
Aug 13, 2021
f038f81
Merge branch 'development' of https://github.com/ODIM-Project/ODIM in…
Aug 13, 2021
93c9b7e
Fixed svc-systems tests related to DeleteVolume.
Aug 13, 2021
74ed5fc
Fixed configs
Aug 17, 2021
b94f940
Merge branch 'development' of https://github.com/ODIM-Project/ODIM in…
Aug 17, 2021
e881acb
Updated dell config script
Aug 18, 2021
3d1e715
Merge branch 'development' of https://github.com/ODIM-Project/ODIM in…
Aug 18, 2021
876f9a6
Changed order of cipher suites
Aug 18, 2021
7252c61
Merge branch 'development' of https://github.com/ODIM-Project/ODIM in…
Aug 31, 2021
3e438dc
License headers added.
Sep 6, 2021
0e9bc55
Kubernetes deployment for dell plugin updated
Sep 6, 2021
a65e51f
Merge branch 'development' into mmis-dell-storage
bharath-b-hpe Sep 8, 2021
7ae1d01
Added OnDisk sentinel port and master set parameters
Sep 8, 2021
804cd33
Removed unnecessary VolumeType parameter validation
Sep 8, 2021
adf0636
Merge branch 'mmis-dell-storage' of https://github.com/ODIM-Project/O…
Sep 8, 2021
f569263
Merge branch 'development' into mmis-dell-storage
bharath-b-hpe Sep 8, 2021
6a3359f
StatusCode included in taskmon
Sep 23, 2021
3721ca7
Merge branch 'development' of https://github.com/ODIM-Project/ODIM in…
Sep 23, 2021
926b445
Merge branch 'development' into mmis-dell-storage
bharath-b-hpe Sep 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ copy: build/odimra/odimra
dep: copy
build/odimra/makedep.sh

build-containers: dep
build-containers: dep
cd build && ./run_pre_reqs.sh && docker-compose build --force-rm --build-arg ODIMRA_USER_ID=${ODIMRA_USER_ID} --build-arg ODIMRA_GROUP_ID=${ODIMRA_GROUP_ID}

standup-containers: build-containers
Expand Down
2 changes: 2 additions & 0 deletions build/DELLPlugin/edit_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ sed -i "s#\"PrivateKeyPath\".*#\"PrivateKeyPath\": \"$t/odimra_server.key\",#"
sed -i "s#\"CertificatePath\".*#\"CertificatePath\": \"$t/odimra_server.crt\"#" /etc/dell_plugin_config/config_dell_plugin.json
sed -i "s#\"LBHost\".*#\"LBHost\": \"$ip\",#" /etc/dell_plugin_config/config_dell_plugin.json
sed -i "s#\"LBPort\".*#\"LBPort\": \"45008\"#" /etc/dell_plugin_config/config_dell_plugin.json
sed -i "s#\"InMemoryHost\".*#\"InMemoryHost\": \"redis\",#" /etc/dell_plugin_config/config_dell_plugin.json
sed -i "s#\"OnDiskHost\".*#\"OnDiskHost\": \"redis\",#" /etc/dell_plugin_config/config_dell_plugin.json
sed -i "s#\"MessageQueueConfigFilePath\".*#\"MessageQueueConfigFilePath\": \"/etc/dell_plugin_config/platformconfig.toml\",#" /etc/dell_plugin_config/config_dell_plugin.json

########changes in platformconfig.toml file ######
Expand Down
4 changes: 4 additions & 0 deletions lib-utilities/config/odimra_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@
{
"ConnectionMethodType": "Redfish",
"ConnectionMethodVariant":"Compute:BasicAuth:URP_v1.0.0"
},
{
"ConnectionMethodType": "Redfish",
"ConnectionMethodVariant":"Compute:BasicAuth:DELL_v1.0.0"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,27 @@ data:
"PrivateKeyPath": "/etc/odimra_certs/odimra_server.key",
"CertificatePath": "/etc/odimra_certs/odimra_server.crt"
},
"DBConf": {
"Protocol": "tcp",
{{ if eq .Values.odimra.haDeploymentEnabled false }}
"InMemoryHost": "redis-inmemory",
"OnDiskHost": "redis-ondisk",
"InMemoryMasterSet": "mymaster",
"OnDiskMasterSet": "mymaster",
{{ else }}
"InMemoryHost": "redis-ha-inmemory",
"OnDiskHost": "redis-ha-ondisk",
"InMemoryMasterSet": "primaryset",
"OnDiskMasterSet": "primaryset",
{{ end }}
"InMemoryPort": "6379",
"OnDiskPort": "6379",
"MaxIdleConns": 200,
"MaxActiveConns": 200,
"RedisHAEnabled": {{ .Values.odimra.haDeploymentEnabled }},
"InMemorySentinelPort": "26379",
"OnDiskSentinelPort": "26379"
},
"TLSConf" : {
"MinVersion": "TLS_1.2",
"MaxVersion": "TLS_1.2",
Expand Down
17 changes: 17 additions & 0 deletions plugin-dell/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type configModel struct {
KeyCertConf *KeyCertConf `json:"KeyCertConf"`
URLTranslation *URLTranslation `json:"URLTranslation"`
TLSConf *TLSConf `json:"TLSConf"`
DBConf *DBConf `json:"DBConf"`
}

//PluginConf is for holding all the plugin related configurations
Expand All @@ -50,6 +51,22 @@ type PluginConf struct {
Password string `json:"Password"`
}

// DBConf holds all DB related configurations
type DBConf struct {
Protocol string `json:"Protocol"`
InMemoryHost string `json:"InMemoryHost"`
InMemoryPort string `json:"InMemoryPort"`
OnDiskHost string `json:"OnDiskHost"`
OnDiskPort string `json:"OnDiskPort"`
MaxIdleConns int `json:"MaxIdleConns"`
MaxActiveConns int `json:"MaxActiveConns"`
RedisHAEnabled bool `json:"RedisHAEnabled"`
InMemorySentinelPort string `json:"InMemorySentinelPort"`
OnDiskSentinelPort string `json:"OnDiskSentinelPort"`
InMemoryMasterSet string `json:"InMemoryMasterSet"`
OnDiskMasterSet string `json:"OnDiskMasterSet"`
}

//LoadBalancerConf is for holding all load balancer related configurations
type LoadBalancerConf struct {
Host string `json:"LBHost"`
Expand Down
16 changes: 15 additions & 1 deletion plugin-dell/config/dell_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@
"PrivateKeyPath": "",
"CertificatePath": ""
},
"DBConf": {
"Protocol": "tcp",
"InMemoryHost": "localhost",
"InMemoryPort": "6379",
"OnDiskHost": "localhost",
"OnDiskPort": "6380",
"MaxIdleConns": 10,
"MaxActiveConns": 120,
"RedisHAEnabled": false,
"InMemorySentinelPort": "26379",
"OnDiskSentinelPort": "26379",
"InMemoryMasterSet": "mymaster",
"OnDiskMasterSet": "mymaster"
},
"TLSConf" : {
"MinVersion": "TLS_1.2",
"MaxVersion": "TLS_1.2",
Expand All @@ -26,7 +40,7 @@
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
"TLS_RSA_WITH_AES_128_GCM_SHA256",
"TLS_RSA_WITH_AES_128_GCM_SHA256",
"TLS_RSA_WITH_AES_256_GCM_SHA384"
]
},
Expand Down
2 changes: 1 addition & 1 deletion plugin-dell/dphandler/biosSettings.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func createBiosResponse() []byte {
Code: response.Success,
Message: "See @Message.ExtendedInfo for more information.",
MessageExtendedInfo: []dpresponse.MsgExtendedInfo{
dpresponse.MsgExtendedInfo{
{
MessageID: response.Success,
Message: "A system reset is required for BIOS settings changes to get affected",
MessageArgs: []string{},
Expand Down
34 changes: 0 additions & 34 deletions plugin-dell/dphandler/bootorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,41 +62,7 @@ func SetDefaultBootOrder(ctx iris.Context) {
Username: deviceDetails.Username,
Password: string(deviceDetails.Password),
}
/*
priv := []byte(dpmodel.PluginPrivateKey)
block, _ := pem.Decode(priv)
enc := x509.IsEncryptedPEMBlock(block)
b := block.Bytes
if enc {
log.Println("is encrypted pem block")
b, err = x509.DecryptPEMBlock(block, nil)
if err != nil {
log.Println("Error: " + err.Error())
}
}
key, err := x509.ParsePKCS1PrivateKey(b)
if err != nil {
log.Println("Error: " + err.Error())
}

hash := sha512.New()

plainText, err := rsa.DecryptOAEP(
hash,
rand.Reader,
key,
device.Password,
nil,
)
if err != nil {
log.Println("Error while trying decrypt data: ", err)
ctx.StatusCode(http.StatusInternalServerError)
ctx.WriteString("Error while trying to decypt data")
return
}

device.Password = plainText
*/
redfishClient, err := dputilities.GetRedfishClient()
if err != nil {
errMsg := "While trying to create the redfish client, got:" + err.Error()
Expand Down
7 changes: 2 additions & 5 deletions plugin-dell/dphandler/pluginStatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"reflect"
"sync"
"time"
//"github.com/ODIM-Project/ODIM/lib-utilities/common"
pluginConfig "github.com/ODIM-Project/ODIM/plugin-dell/config"
"github.com/ODIM-Project/ODIM/plugin-dell/dpmodel"
"github.com/ODIM-Project/ODIM/plugin-dell/dpresponse"
Expand All @@ -48,8 +47,8 @@ func GetPluginStatus(ctx iris.Context) {
}
var messageQueueInfo []dpresponse.EmbQueue
var resp = dpresponse.PluginStatusResponse{
Comment: "Plugin Status Response",
Name: "Common Redfish Plugin Status",
Comment: "Dell Plugin Status Response",
Name: "Dell Redfish Plugin Status",
Version: pluginConfig.Data.FirmwareVersion,
}
resp.Status = dputilities.Status
Expand Down Expand Up @@ -205,7 +204,6 @@ func checkCreateSub(server dpmodel.DeviceData, startUpResponse chan map[string]s
Destination: "https://" + pluginConfig.Data.LoadBalancerConf.Host + ":" + pluginConfig.Data.LoadBalancerConf.Port + pluginConfig.Data.EventConf.DestURI,
EventTypes: server.EventSubscriptionInfo.EventTypes,
Context: "Event Subscription",
// HTTPHeaders: reqPostBody.HTTPHeaders,
Protocol: "Redfish",
}
device.PostBody, err = json.Marshal(req)
Expand All @@ -229,7 +227,6 @@ func checkCreateSub(server dpmodel.DeviceData, startUpResponse chan map[string]s
Destination: "https://" + pluginConfig.Data.LoadBalancerConf.Host + ":" + pluginConfig.Data.LoadBalancerConf.Port + pluginConfig.Data.EventConf.DestURI,
EventTypes: []string{"Alert"},
Context: "Event Subscription",
// HTTPHeaders: reqPostBody.HTTPHeaders,
Protocol: "Redfish",
}
device.PostBody, err = json.Marshal(req)
Expand Down
18 changes: 2 additions & 16 deletions plugin-dell/dphandler/redfishEvents.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,13 @@ import (
"encoding/json"
"github.com/ODIM-Project/ODIM/lib-utilities/common"
pluginConfig "github.com/ODIM-Project/ODIM/plugin-dell/config"
"github.com/ODIM-Project/ODIM/plugin-dell/dputilities"
log "github.com/sirupsen/logrus"
"net"
"net/http"
"strings"
)

var (
// In Channel
In chan<- interface{}
// Out Channel
Out <-chan interface{}
)

// RedfishEvents receives the subscribed events from the south bound system
// Then it will send the received data and ip to publish method
// RedfishEvents receives the subscribed events from the south bound system
Expand Down Expand Up @@ -76,14 +70,6 @@ func RedfishEvents(w http.ResponseWriter, r *http.Request) {
}

// Call writeEventToJobQueue to write events to worker pool
writeEventToJobQueue(event)
dputilities.WriteEventToJobQueue(event)
w.WriteHeader(http.StatusOK)
}

// writeEventToJobQueue will write events to worker pool
func writeEventToJobQueue(event common.Events) {
var events []interface{}
events = append(events, event)
done := make(chan bool)
go common.RunWriteWorkers(In, events, 5, done)
}
33 changes: 0 additions & 33 deletions plugin-dell/dphandler/reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,40 +63,7 @@ func ResetComputerSystem(ctx iris.Context) {
Username: deviceDetails.Username,
Password: string(deviceDetails.Password),
}
/*
priv := []byte(dpmodel.PluginPrivateKey)
block, _ := pem.Decode(priv)
enc := x509.IsEncryptedPEMBlock(block)
b := block.Bytes
if enc {
log.Println("is encrypted pem block")
b, err = x509.DecryptPEMBlock(block, nil)
if err != nil {
log.Println("Error: " + err.Error())
}
}
key, err := x509.ParsePKCS1PrivateKey(b)
if err != nil {
log.Println("Error: " + err.Error())
}

hash := sha512.New()

plainText, err := rsa.DecryptOAEP(
hash,
rand.Reader,
key,
device.Password,
nil,
)
if err != nil {
log.Println("Error while trying decrypt data: ", err)
ctx.StatusCode(http.StatusInternalServerError)
ctx.WriteString("Error while trying to decypt data")
return
}
device.Password = plainText
*/
var request map[string]interface{}
err = json.Unmarshal(deviceDetails.PostBody, &request)
resetType := request["ResetType"].(string)
Expand Down
Loading