diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.spec.ts index 522c60f8737..e6d0031b6d5 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.spec.ts @@ -206,7 +206,7 @@ describe('RbdSnapshotListComponent', () => { it('should display suggested snapshot name', () => { component.openCreateSnapshotModal(); expect(component.modalRef.content.snapName).toMatch( - RegExp(`^${component.rbdName}-\\d+T\\d+Z\$`) + RegExp(`^${component.rbdName}_[\\d-]+T[\\d.:]+\\+[\\d:]+\$`) ); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts index cc40bea3032..101525bf30b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts @@ -167,9 +167,7 @@ export class RbdSnapshotListComponent implements OnInit, OnChanges { } else { // Auto-create a name for the snapshot: _ // https://en.wikipedia.org/wiki/ISO_8601 - snapName = `${this.rbdName}-${moment() - .utc() - .format('YYYYMMDD[T]HHmmss[Z]')}`; + snapName = `${this.rbdName}_${moment().toISOString(true)}`; } this.modalRef.content.setSnapName(snapName); this.modalRef.content.onSubmit.subscribe((snapshotName: string) => {