Cloud Code의 Compute Engine 통합을 통해 애플리케이션을 실행하는 Compute Engine VM을 보고, SSH를 사용하여 VM에 대한 연결을 설정하고, 애플리케이션 로그를 보고, VM에 파일을 업로드할 수 있습니다.
이 문서에서는 IDE에서 Cloud Code로 Compute Engine에 액세스하고 VM 인스턴스를 관리하는 방법을 보여줍니다.
VM 보기
Google Cloud 콘솔에서 Google Cloud 프로젝트의 VM과 VM 인스턴스 세부정보를 보려면 다음 단계를 수행합니다.
IDE에서 아직 Cloud Code에 로그인하지 않았으면 Cloud Code에 로그인하고 Google Cloud 프로젝트를 선택합니다.
Google Cloud 프로젝트에서 VM 인스턴스를 보려면 IDE의 작업 표시줄에서 Cloud Code를 클릭한 후 Compute Engine 탐색기를 펼칩니다.
Google Cloud 콘솔에서 VM 인스턴스 세부정보를 보려면 VM 인스턴스를 마우스 오른쪽 버튼으로 클릭하고 Cloud 콘솔에서 열기를 선택합니다.
VM에 연결
기본 제공되는 IDE 터미널 및 SSH를 사용하여 Cloud Code에서 IDE의 VM 인스턴스에 연결하려면 다음 단계를 따르세요.
VM 인스턴스에 연결하려면 Compute Engine 탐색기에서 VM 인스턴스 위에 마우스 포인터를 올려놓고 터미널SSH 열기를 클릭하거나 VM 인스턴스를 마우스 오른쪽 버튼으로 클릭하고 SSH 열기를 선택합니다.
원격 인스턴스에 대한 정보가 표시된 터미널이 나타납니다.
VM 인스턴스에 연결하지 못한 경우 다음을 수행합니다.
Windows 및 Linux 사용자의 경우 SSH 오류 문제 해결에서 SSH를 사용하여 VM에 연결할 때 발생할 수 있는 일반적인 오류, 오류 해결 방법, 실패한 SSH 연결 진단 방법을 확인하세요.
macOS 사용자의 경우 아무 키나 눌러 터미널에서 오류 메시지를 지우면 오류 메시지 대화상자가 나타납니다. 터미널에서 문제 및 잠재적 해결 방법에 대한 정보를 보려면 문제 해결을 클릭합니다. 또는 SSH 오류 문제 해결 문서를 보려면 자세히 알아보기를 클릭합니다.
VM에서 애플리케이션 로그 보기
VM 인스턴스의 애플리케이션 로그를 보려면 다음 단계를 따르세요.
Cloud Code에서 VM 인스턴스의 애플리케이션 로그를 보려면 VM 인스턴스를 마우스 오른쪽 버튼으로 클릭하고 로그 보기를 선택합니다.
IDE에 로그 뷰어 창이 나타나고 로그 유형, 시간, 심각도, 인스턴스별로 필터링할 수 있습니다.
실시간으로 로그를 보려면 스트리밍 전환 버튼을 사용 설정합니다.
Google Cloud 콘솔에서 특정 VM 인스턴스의 로깅 페이지를 보려면 open_in_new브라우저에서 열기를 클릭합니다.
VM에 파일 업로드
로컬 IDE에서 원격 VM 인스턴스로 애플리케이션 파일을 복사하려면 다음 단계를 수행합니다.
VM에 파일을 업로드하려면 Cloud Code Compute Engine 탐색기에서 VM 인스턴스 위에 마우스 포인터를 올려놓고 cloud_uploadSCP를 통해 파일 업로드를 클릭하거나 VM 인스턴스를 마우스 오른쪽 버튼으로 클릭하고 SCP를 통해 파일 업로드를 선택합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-12-21(UTC)"],[[["\u003cp\u003eCloud Code enables you to view, manage, and connect to Compute Engine VMs directly within your IDE.\u003c/p\u003e\n"],["\u003cp\u003eYou can establish SSH connections to your VMs using Cloud Code's built-in terminal, with troubleshooting resources available for connection issues.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code allows you to view application logs from your VM instances within the IDE's Logs Viewer, including real-time streaming and filtering options.\u003c/p\u003e\n"],["\u003cp\u003eWith Cloud Code, you can upload files from your local machine to Linux VMs via SCP, facilitating application deployment and file transfer.\u003c/p\u003e\n"]]],[],null,["# Manage VMs in Cloud Code for VS Code\n\nWith Cloud Code's Compute Engine integration, you can view the Compute Engine VMs running your applications, establish connections to your VMs using SSH, view application logs, and upload files to a VM.\n\n\u003cbr /\u003e\n\nThis document shows you how to access Compute Engine with\nCloud Code in your IDE and manage your VM instances.\n\nView VMs\n--------\n\nTo view VMs in your Google Cloud project and the VM instance details in\nthe Google Cloud console, follow these steps:\n\n1. In your IDE, sign into Cloud Code if you haven't already, and\n select your Google Cloud project.\n\n2. To view VM instances in your Google Cloud project, in the activity bar\n of your IDE, click **Cloud Code** and then expand the\n **Compute Engine** explorer.\n\n3. To view the VM instance details in the Google Cloud console, right-click the\n VM instance and select **Open in Cloud Console**.\n\nConnect to a VM\n---------------\n\nTo connect to the VM instance in your IDE with Cloud Code using the\nbuilt-in IDE terminal and SSH, follow these steps:\n\n1. To connect to a VM instance, in the **Compute Engine** explorer, hold the\n pointer over the VM instance and click\n terminal **Open SSH** or right-click\n the VM instance and select **Open SSH**.\n\n A terminal appears, displaying information about the remote instance.\n2. If the connection to the VM instance fails:\n\n - For Windows and Linux users, see\n [Troubleshooting SSH errors](/compute/docs/troubleshooting/troubleshooting-ssh-errors)\n for common errors that you might run into when connecting to a VM using SSH,\n ways to resolve errors, and methods for diagnosing failed SSH connections.\n\n - For macOS users, after pressing any key to clear the error message in the\n terminal, an error message dialog appears. To view\n information in the terminal about the issue and potential resolutions,\n click **Troubleshoot** . Or, to view the\n [Troubleshooting SSH errors](/compute/docs/troubleshooting/troubleshooting-ssh-errors)\n documentation, click **Learn more**.\n\nView application logs on a VM\n-----------------------------\n\nTo view the application logs of a VM instance, follow these steps:\n\n1. To view the application logs of a VM instance in Cloud Code,\n right-click the VM instance and select **View Logs**.\n\n The Logs Viewer window appears in your IDE, allowing you to filter by log\n type, time, severity, and instance.\n2. To view logs in real time, turn on the **Streaming** toggle.\n\n3. To view the logging page for a particular VM instance in the Google Cloud console,\n click open_in_new\n **Open in browser**.\n\nUpload a file to a VM\n---------------------\n\nTo copy application files from your local IDE to your remote VM instance, follow\nthese steps:\n| **Note:** Cloud Code only supports [transferring files to Linux\n| VMs](/compute/docs/instances/transfer-files). For additional options for Windows machines, see [Transfer files to Windows VMs](/compute/docs/instances/transfer-files-windows).\n\n1. To upload a file to a VM, in the Cloud Code **Compute Engine**\n explorer, hold the pointer over the VM instance and click\n cloud_upload\n **Upload File via SCP** , or right-click the VM instance and select **Upload\n File via SCP**.\n\n2. Navigate to the file that you want to upload and click **Upload**."]]