[문의사항]

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 생성되는 과정입니다.

 

 

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:

  1. The requester asks the Volume Shadow Copy Service to enumerate the writers, gather the writer metadata, and prepare for shadow copy creation.
  2. 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.
  3. The Volume Shadow Copy Service notifies all the writers to prepare their data for making a shadow copy.
  4. 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.
  5. 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.
  6. 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.
  7. The Volume Shadow Copy Service releases file system write I/O requests. 
  8. 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.

  1. The requester can retry the process (go back to step 1) or notify the administrator to retry at a later time.
  2. 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

'Microsoft > Platform' 카테고리의 다른 글

특정폴더의 현재 소유자의 변경 방법  (0) 2017.02.16
Administrative Templates (.admx) 오류시 해결방법  (0) 2016.11.22
winsxs 폴더 정리 방법  (0) 2016.11.21
덤프수집의 종류  (0) 2015.12.18
성능수집 가이드  (0) 2015.12.18

[전체 메모리 덤프 설정]

 1. 제어판 - 시스템 - 고급 - 시작 및 복구

2. 디버깅 정보 쓰기를 “전체 메모리 덤프” 로 설정합니다.

UI 에서 전체 메모리 덤프를 설정하지 못할 경우 아래 값을 설정해 주십시오.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CrashControl

CrashDumpEnabled=0x1(REG_DWORD)

(참고! 1: 전체 메모리 덤프, 2: 커널 메모리 덤프, 3: 미니 덤프)

3. 기존 파일에 덮어쓰기 : 옵션 선택 확인 (선택되어 있는지 확인하십시오.)

4. %SystemRoot% 파티션에 Paging 파일이 존재해야 합니다.

5. System root 에 있는 Paging 파일의 크기가 물리적인 메모리보다 커야 합니다. (C:\ D:\ 등으로 페이지 파일이 나뉘어 있어도 C:\에 있는 페이지 파일의 크기가 물리 메모리 보다 커야 합니다.)

아래는 물리 메모리가 4GB 일 경우 100MB 크게 설정하는 예 입니다.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PageFiles

c:\pagefile.sys 4196 4196

6. 설정 변경 후 시스템 재 부팅이 필요합니다.

7. 기본적으로 메모리 덤프는 C:\Windows\(%SystemRoot%) 에 저장됩니다. C Drive 에 공간이 충분히 있는지 확인하십시오.

  

[Dedicated Dump 설정]

 Windows Server 2008 이상 버전의 경우 다음과 같이 Dedicated Dump를 설정하여 다른 드라이브에 덤프 전용 페이징파일을 설정할 수 있습니다. 레지스트리 수정 후 적용을 위해서는 시스템 재시작이 필요합니다.

 

Dedicated Dump File (덤프수집 용도의 Pagefile)이 위치할 경로

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\CrashControl

DedicatedDumpFile(REG_SZ)

Value: D:\DedicatedDumpfile.sys

 

위에서 설정한 DedicatedDumpFile.sys의 크기 지정

전체메모리덤프의 경우 실제메모리 크기보다 최소 10MB 이상 크게 설정해야 합니다.

(아래 4196 값은 실제 메모리가 4096MB(4GB)인 경우에 실제 메모리보다 100MB 크게 설정한 예.)

DumpFileSize(REG_DWORD)

Value: 4196

 

메모리덤프(MEMORY.DMP)가 생성될 위치

DumpFile(REG_EXPAND_SZ)

Value: D:\temp\MEMORY.DMP

 

[키보드를 이용한 크래쉬 메모리 덤프 설정 및 수집]

 1. 레지스트리 편집기를 실행하여 아래 레지스트리 키를 추가한 후, 이를 적용하기 위해서는 시스템 재시작이 필요합니다.

키보드 종류에 따라서 레지스트리 설정방법이 다를 수 있으므로 PS2, USB 모두 적용합니다.

 

PS2 키보드에 대한 레지스트리 설정

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt\Parameters

CrashOnCtrlScroll=0x1(REG_DWORD)

 

USB 키보드에 대한 레지스트리 설정

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\kbdhid\Parameters

CrashOnCtrlScroll=0x1(REG_DWORD)

 

2. 문제가 다시 발생하면, 문제 현상이 10분 정도 지속된 이 후에 오른쪽 Ctrl 키를 누른 상태에서 Scroll Lock 키를 두 번 눌러 행 덤프를 강제 수집합니다.

  

[키보드 덤프 설정 – 키 변경]

 키보드에 오른쪽 Ctrl이 없는 경우 아래 레지스트리 값을 설정하여 키 조합을 변경할 수 있습니다.

레지스트리 수정 후 적용을 위해서는 시스템 재시작이 필요합니다.

 

왼쪽 Ctrl + Scroll Lock 으로 설정

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt\CrashDump

CrashOnCtrlScroll=0x0(REG_DWORD)

Dump1Keys=0x20 (REG_DWORD)

Dump2Key=0x7d (REG_DWORD)

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt\Parameters

값 이름: CrashOnCtrlScroll=0x0 (REG_DWORD)

 

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\kbdhid\CrashDump

CrashOnCtrlScroll=0x0(REG_DWORD)

Dump1Keys=0x20 (REG_DWORD)

Dump2Key=0x7d (REG_DWORD)

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\kbdhid\Parameters

값 이름: CrashOnCtrlScroll=0x0 (REG_DWORD)

 

 

Scroll Lock 이 없을 경우 왼쪽 Ctrl + A 두 번 누르게 설정

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt\Crashdump

CrashOnCtrlScroll=0x0(REG_DWORD)

Dump1Keys=0x20 (REG_DWORD)

Dump2Key=0x1f (REG_DWORD)

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt\Parameters

CrashOnCtrlScroll=0x0 (REG_DWORD)

 

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\kbdhid\CrashDump

CrashOnCtrlScroll=0x0(REG_DWORD)

Dump1Keys=0x20 (REG_DWORD)

Dump2Key=0x1f (REG_DWORD)

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\kbdhid\Parameters

값 이름: CrashOnCtrlScroll=0x0 (REG_DWORD)


>성능 로그 수집


다음 방법은 1 간격으로 성능 로그를 수집 하는 방법 입니다. 문제가 재현 되면 수집 문제가 사라지면 중지 주십시오.

 

1) 명령창(cmd.exe) 실행합니다. (관리자 권한으로 실행합니다)

2) C:\ 드라이브에 C:\PerfLogs 폴더를 생성합니다.

3) 다음 명령을 Copy and Paste하여 명령 실행창에 실행합니다. 그러면 Perfmon PerfLog-Long라는 Counter 생성합니다.

Logman.exe create counter PerfLog-Long -o "c:\perflogs\PerfLog-Long.blg" -f bincirc -v mmddhhmm -max 800 -c "\LogicalDisk(*)\*" "\Memory\*" "\PhysicalDisk(*)\*" "\Processor(*)\*" "\Process(*)\*" "\System\*" "\Server\*" "\Thread(*)\*" "\Objects\*" "\Network Interface(*)\*"  "\Paging File(*)\*" -si 00:00:01

 



 

 

4) Log 수집을 시작하기 위해서는 다음을 실행합니다.

Logman.exe start PerfLog-Long

 

5) 문제 증상이 재현될 때까지 성능 모니터 로그를 계속 수집합니다.

6) 문제 증상이 발생하면, Log 수집을 종료하기 위해서 다음을 실행합니다.

Logman.exe stop PerfLog-Long

 

7) 자료는 C:\PerfLogs\ 폴더 아래에 PerfLog-Long.blg 파일로 생성이 됩니다.

8) 생성된 Counter 로그를 제거하려면 아래 명령을 실행합니다.

Logman.exe delete counter PerfLog-Long

 

 

 

+ Recent posts