Don't allow the migration command to be executed if not enabled currently

This commit is contained in:
Dane Everitt 2021-07-04 12:37:08 -07:00 committed by DaneEveritt
parent dfe5a77e0a
commit a6a610fd82
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53

View File

@ -47,6 +47,9 @@ func newMigrateVHDCommand() *cobra.Command {
// Run executes the migration command.
func (m *MigrateVHDCommand) Run(ctx context.Context) error {
if !config.Get().System.UseVirtualDisks {
return errors.New("cannot migrate to vhd: configuration file \"system.use_virtual_disks\" value is set to \"false\"")
}
for _, s := range m.manager.All() {
s.Log().Debug("starting migration of server contents to virtual disk...")