[문의사항]
VSS 문의
[대상시스템]
Windows2008 R2
[확인사항]
1. Volume Shadow Copy 서비스가 실행될 때 shadow copy본에 대한 정합성을 위해서 File Io를 일시적으로 멈추게 하거나 다른 방법을 사용할텐데,특정 파일에 대한 Lock이 걸려서, 다른 프로세스가 이용하지 못 할 수 있는지 궁금합니다.
[답변]
VSS 작동중에 쓰기I/O요청에 대해 멈추는 것이 맞습니다.
잘 아시다시피 VSS(Volume Shadow Service)란 특정 시점에 일관된 데이터 복사본을 생성하는 서비스이며,
복사본 생성 시 1)Clone , 2)Copy-on-write라는 두 개의 메커니즘을 하나로 만들며 주요 컴포넌트는 VSS Writer, Provider 및 Requestor가 있습니다.
아래의 그림은 Volume Shadow Copy가 생성되는 과정입니다.
![](https://t1.daumcdn.net/cfile/tistory/236BB54F5678CFE729)
requestor가 VSS에게 writer를 요청을 하게 되며, writer는 고유의 방법으로 복사본을 준비하는 과정이 진행됩니다. (예 트랜젝션을 정리하단다던 캐시를 비우는 작업등..)
VSS는 각 writer에게 모든 쓰기 I/O 요청을 잠시 멈추게 명령하며 VSS는 복사본이 생성되는 동안 I/O 요청들을 잘 보관하고 있었는지 writer에게 확인해 생성된 shadow copy가 무결함을 보장하는 프로세스 입니다.
To create a shadow copy, the requester, writer, and provider perform the following actions:
- The requester asks the Volume Shadow Copy Service to enumerate the writers, gather the writer metadata, and prepare for shadow copy creation.
- Each writer creates an XML description of the components and data stores that need to be backed up and provides it to the Volume Shadow Copy Service. The writer also defines a restore method, which is used for all components. The Volume Shadow Copy Service provides the writer's description to the requester, which selects the components that will be backed up.
- The Volume Shadow Copy Service notifies all the writers to prepare their data for making a shadow copy.
- Each writer prepares the data as appropriate, such as completing all open transactions, rolling transaction logs, and flushing caches. When the data is ready to be shadow-copied, the writer notifies the Volume Shadow Copy Service.
- The Volume Shadow Copy Service tells the writers to temporarily freeze application write I/O requests (read I/O requests are still possible) for the few seconds that are required to create the shadow copy of the volume or volumes. The application freeze is not allowed to take longer than 60 seconds. The Volume Shadow Copy Service flushes the file system buffers and then freezes the file system, which ensures that the file system metadata is recorded correctly and the data to be shadow-copied is written in a consistent order.
- The Volume Shadow Copy Service tells the provider to create the shadow copy. The shadow copy creation period lasts no more than 10 seconds, during which all write I/O requests to the file system remain frozen.
- The Volume Shadow Copy Service releases file system write I/O requests.
- VSS tells the writers to thaw application write I/O requests. At this point applications are free to resume writing data to the disk that is being shadow-copied.
Note |
The shadow copy creation can be aborted if the writers are kept in the freeze state for longer than 60 seconds or if the providers take longer than 10 seconds to commit the shadow copy. |
- The requester can retry the process (go back to step 1) or notify the administrator to retry at a later time.
- If the shadow copy is successfully created, the Volume Shadow Copy Service returns the location information for the shadow copy to the requester. In some cases, the shadow copy can be temporarily made available as a read-write volume so that VSS and one or more applications can alter the contents of the shadow copy before the shadow copy is finished. After VSS and the applications make their alterations, the shadow copy is made read-only. This phase is called Auto-recovery, and it is used to undo any file-system or application transactions on the shadow copy volume that were not completed before the shadow copy was created.
[참조] Volume Shadow Copy Service
http://technet.microsoft.com/en-us/library/ee923636(v=ws.10).aspx>
2.쉐도우 카피 서비스가 실행해서, 하는 동작에 대해서 log를 남길수 있도록 Trace를 걸 수 있는 방법이 있는지 궁금합니다.
VSS Trace Log를 사용할수 있는 도구로는 VssTrace/Logman/Tracelog 3가지가 있는데 현재 Logman으로 VSS로그를 확인할수 있습니다.
다만 .etl로그로 덜어져서 .etl로그를 txt로 변경작업이 필요 합니다.
//logman//
-CMD
시작 : logman start vss -o z:\vss.etl -ets -p {WriterID} 255
중지 : logman stop vss -ets |
Level |
Information included in the trace output |
0 |
None |
20 |
Fatal errors |
30 |
Unhandled exceptions |
40 |
Errors |
50 |
Assertions |
60 |
Warnings |
80 |
Exception handling |
100 |
Event Log activity |
120 |
General information |
140 |
Code flow |
160 |
Function enter and exit |
170 |
Function return values |
180 |
Function parameters (terse) |
190 |
Function parameters (verbose) |
200 |
Verbose information level 1 |
210 |
Verbose information level 2 |
220 |
Verbose information level 3 |
230 |
Fast Code Level 1 |
240 |
Fast Code Level 2 |
250 |
Fast Code Level 3 |
255 |
All |
//etl -> .txt//
-CMD
tracerpt /l Z:\test\vss_trace.etl(파일 경로) |
[참조] Using Tracing Tools with VSS
https://msdn.microsoft.com/en-us/library/windows/desktop/dd765233(v=vs.85).aspx