mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
feat(region): add options DeleteSnapshotExpiredRelease
This commit is contained in:
@@ -4715,6 +4715,7 @@ func (manager *SGuestManager) DeleteExpiredPrepaidServers(ctx context.Context, u
|
||||
if guests == nil {
|
||||
return
|
||||
}
|
||||
deteleSnapshot := options.Options.DeleteSnapshotExpiredRelease
|
||||
for i := 0; i < len(guests); i += 1 {
|
||||
// fake delete expired prepaid servers
|
||||
if len(guests[i].ExternalId) > 0 {
|
||||
@@ -4724,7 +4725,7 @@ func (manager *SGuestManager) DeleteExpiredPrepaidServers(ctx context.Context, u
|
||||
}
|
||||
}
|
||||
guests[i].SetDisableDelete(userCred, false)
|
||||
guests[i].StartDeleteGuestTask(ctx, userCred, "", false, false, false)
|
||||
guests[i].StartDeleteGuestTask(ctx, userCred, "", false, false, deteleSnapshot)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -161,6 +161,7 @@ type ComputeOptions struct {
|
||||
common_options.DBOptions
|
||||
|
||||
EnableAutoMergeSecurityGroup bool `help:"Enable auto merge secgroup when sync security group from cloud, default False" default:"false"`
|
||||
DeleteSnapshotExpiredRelease bool `help:"Should the virtual machine be automatically deleted when the virtual machine expires?" default:"false"`
|
||||
|
||||
DefaultNetworkGatewayAddressEsxi uint32 `help:"Default address for network gateway" default:"1"`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user