@@ -71,6 +71,10 @@ func setupCaching(devicePath string, req *csi.NodeStageVolumeRequest, nodeId str
71
71
if vgExists {
72
72
// Clean up Volume Group before adding the PD
73
73
reduceVolumeGroup (volumeGroupName , true )
74
+ info , err := common .RunCommand ("" /* pipedCmd */ , nil /* pipedCmdArg */ , "vgextend" , []string {volumeGroupName , raidedLocalSsdPath }... )
75
+ if err != nil {
76
+ return "" , fmt .Errorf ("errored while extending volume group to add localssd %v, error: %v: %s" , raidedLocalSsdPath , err , info )
77
+ }
74
78
} else {
75
79
err := createVg (volumeGroupName , raidedLocalSsdPath )
76
80
if err != nil {
@@ -581,33 +585,6 @@ func fetchChunkSizeKiB(cacheSize string) (string, error) {
581
585
return strconv .FormatInt (int64 (chunkSize ), 10 ) + "KiB" , nil
582
586
}
583
587
584
- func InitializeDataCacheNode (nodeId string ) error {
585
- raidedLocalSsdPath , err := fetchRAIDedLocalSsdPath ()
586
- if err != nil {
587
- return err
588
- }
589
- volumeGroupName := getVolumeGroupName (nodeId )
590
-
591
- vgExists := checkVgExists (volumeGroupName )
592
- // Check if the required volume group already exists
593
- if vgExists {
594
- // Clean up Volume Group before adding the PD
595
- reduceVolumeGroup (volumeGroupName , true )
596
-
597
- // validate that raidedLSSD is part of VG
598
- err = validateRaidedLSSDinVG (volumeGroupName , raidedLocalSsdPath )
599
- if err != nil {
600
- return fmt .Errorf ("failed validate local ssd in vg %v: %v" , volumeGroupName , err )
601
- }
602
- } else {
603
- err := createVg (volumeGroupName , raidedLocalSsdPath )
604
- if err != nil {
605
- return err
606
- }
607
- }
608
- return nil
609
- }
610
-
611
588
func StartWatcher (nodeName string ) {
612
589
dirToWatch := "/dev/"
613
590
watcher , err := fsnotify .NewWatcher ()
0 commit comments