diff --git a/pkg/hostman/storageman/storagehandler/storagehandler.go b/pkg/hostman/storageman/storagehandler/storagehandler.go index 4a19fe223c..048c331572 100644 --- a/pkg/hostman/storageman/storagehandler/storagehandler.go +++ b/pkg/hostman/storageman/storagehandler/storagehandler.go @@ -21,6 +21,7 @@ import ( "yunion.io/x/jsonutils" "yunion.io/x/log" + "yunion.io/x/pkg/errors" "yunion.io/x/onecloud/pkg/appsrv" "yunion.io/x/onecloud/pkg/hostman/hostutils" @@ -116,6 +117,10 @@ func storageAttach(ctx context.Context, body jsonutils.JSONObject) (interface{}, if err := storage.SetStorageInfo(storageId, storageName, storageConf); err != nil { return nil, err } + err = storage.SyncStorageSize() + if err != nil { + return nil, errors.Wrapf(err, "SyncStorageSize") + } resp, err := storage.SyncStorageInfo() if err != nil { return nil, err