diff --git a/build/glance/root/opt/yunion/share/notify_templates/glance/content/IMAGE_ACTIVED b/build/glance/root/opt/yunion/share/notify_templates/image/content/IMAGE_ACTIVED similarity index 100% rename from build/glance/root/opt/yunion/share/notify_templates/glance/content/IMAGE_ACTIVED rename to build/glance/root/opt/yunion/share/notify_templates/image/content/IMAGE_ACTIVED diff --git a/build/glance/root/opt/yunion/share/notify_templates/glance/title/IMAGE_ACTIVED b/build/glance/root/opt/yunion/share/notify_templates/image/title/IMAGE_ACTIVED similarity index 100% rename from build/glance/root/opt/yunion/share/notify_templates/glance/title/IMAGE_ACTIVED rename to build/glance/root/opt/yunion/share/notify_templates/image/title/IMAGE_ACTIVED diff --git a/pkg/image/models/images.go b/pkg/image/models/images.go index 804d806817..315ea6bd5c 100644 --- a/pkg/image/models/images.go +++ b/pkg/image/models/images.go @@ -370,7 +370,7 @@ func (self *SImage) saveSuccess(userCred mcclient.TokenCredential, msg string) { func (self *SImage) saveFailed(userCred mcclient.TokenCredential, msg string) { log.Errorf(msg) - self.SetStatus(userCred, api.IMAGE_STATUS_QUEUED, msg) + self.SetStatus(userCred, api.IMAGE_STATUS_KILLED, msg) db.OpsLog.LogEvent(self, db.ACT_SAVE_FAIL, msg, userCred) } diff --git a/pkg/image/service/service.go b/pkg/image/service/service.go index 70d748cce7..1732a655d9 100644 --- a/pkg/image/service/service.go +++ b/pkg/image/service/service.go @@ -28,6 +28,7 @@ import ( "yunion.io/x/onecloud/pkg/cloudcommon/cronman" "yunion.io/x/onecloud/pkg/cloudcommon/db" common_options "yunion.io/x/onecloud/pkg/cloudcommon/options" + "yunion.io/x/onecloud/pkg/hostman/storageman/nbd" "yunion.io/x/onecloud/pkg/image/models" "yunion.io/x/onecloud/pkg/image/options" _ "yunion.io/x/onecloud/pkg/image/tasks" @@ -103,6 +104,8 @@ func StartService() { go models.CheckImages() + nbd.Init() // init nbd module for image probe + cron := cronman.GetCronJobManager(true) cron.AddJob1("CleanPendingDeleteImages", time.Duration(options.Options.PendingDeleteCheckSeconds)*time.Second, models.ImageManager.CleanPendingDeleteImages)