

#grant SQL Server Startup account full access to the new drive Get-VirtualDisk -FriendlyName TempDBDisk | Get-Disk | Initialize-Disk -Passthru | New-Partition -DriveLetter T -UseMaximumSize | Format-Volume -FileSystem ReFS -AllocationUnitSize 65536 -NewFileSystemLabel TempDBfiles -Confirm:$false New-VirtualDisk -StoragePoolFriendlyName TempDBPool -FriendlyName TempDBDisk -ResiliencySettingName simple -ProvisioningType Fixed -UseMaximumSize

New-StoragePool -FriendlyName TempDBPool -StorageSubsystemFriendlyName "Windows Storage*" -PhysicalDisks $NVMe # Create pool and virtual disk for TempDB using the local NVMe, ReFS 64K, T: Drive Server startup will fail because tempdb wasn’t initialized.

To make sure that the instance store volume is initialized before SQL Server starts inĬase of instance reboots or start/stop, follow the steps in the next section. You will see the tempdb files created at the new location, as shown in the followingĭelete the tempdb files from the old location. Restart SQL Server to use the new location for tempdb. Grant the SQL Server startup account permissions to the new location of the tempdbĭatabase, so it can create the tempdb files, as shown in the following Also, if you go to EC2->Instances and then look under column “Root Device” of your instance and if it says “ebs”, then you don’t have to worry about data on your root device.ALTER DATABASE TempDB MODIFY FILE (NAME = tempdev, FILENAME = 'T:\tempdb.mdf',SIZE = 524288KB)ĪLTER DATABASE TempDB MODIFY FILE (NAME = temp2, FILENAME = 'T:\tempdb_mssql_2.ndf',SIZE = 524288KB)ĪLTER DATABASE TempDB MODIFY FILE (NAME = temp3, FILENAME = 'T:\tempdb_mssql_3.ndf',SIZE = 524288KB)ĪLTER DATABASE TempDB MODIFY FILE (NAME = temp4, FILENAME = 'T:\tempdb_mssql_4.ndf',SIZE = 524288KB)ĪLTER DATABASE TempDB MODIFY FILE (NAME = templog, FILENAME = 'T:\templog.ldf')

If you are not sure what type of volume you have, look under EC2->Elastic Block Store->Volumes in your AWS console and if your AMI root volume is listed there then you are safe. If you choose to create AMI backed by EBS then your root volume is backed by EBS and everything you have on your root volume will be saved between reboots. If you “stop” an instance that is backed by EBS then the information on the root volume will still be in the same state when you “start” the machine again.īasically, root volume (your entire virtual system disk) is ephemeral, but only if you choose to create AMI backed by Amazon EC2 instance store. There is a difference between “stop” and “terminate”. Meaning of “Warning: Please note that any data on the ephemeral storage of your instance will be lost when it is stopped” Then, when you launch a new instance based on that AMI it will contain everything as it is now. You can create an AMI from your current machine state, which will contain everything in your ephemeral storage. If you don’t mount an ebs volume and save stuff on it, then I believe everything will be lost. For instance, if you mount your ebs volume at /mystuff, then anything not in /mystuff will be lost. What data is stored in ephemeral storage of an Amazon EC2 instance?Īnything that is not stored on an ebs volume that is mounted to the instance will be lost.
