Import SWG Raw Disk Image
To create a SWG custom image in your GCP environment, follow the steps below:
- Download the raw image from the Content & Cloud Security Portal using the provided link.
- Sign in to your G-Cloud account and create a Cloud Storage bucket in the appropriate project.
- Open the newly created bucket.
- In the Objects tab, click Upload > Upload files, and browse the image .raw file on your local machine and start uploading.
The upload status bar appears at the bottom of the screen.
- Once uploaded, click the uploaded image and copy the gsutil URI.
- In the GCP console, search for and select Cloud Build API.
- Click Enable, and verify that the status changes to Enabled.
You can skip this step if the Cloud Build API is already enabled.
- Open the G-Cloud CLI and select the appropriate project.
- Run the command in the CLI.
Sample command:
gcloud compute images import swg-12-2-18-54125 \ --source-file=gs://swg-test-image-upload/12.2.18-54125.raw \ --family=swg \--guest-environment \ --network=https://www.googleapis.com/compute/v...ks/vpc5-purple \ --subnet=https://www.googleapis.com/compute/v.../asia-south1-1 \ --log-location=gs://swg-test-image-upload/Build_logs/ \ --no-address --zone=asia-south1-a --os=centos-7
Update the sample command based on your project configurations:
- Image name: Replace
swg-12-2-18-54125
with your preferred image name.
Follow the GCP recommended custom image name format. - source-file: Use the full gsutil URI of the uploaded
.raw
file copied from Step 5. - network: Provide your project’s VPC network URI.
- subnet: Provide the corresponding subnet URI for your selected region.
- log-location: Specify a bucket path to store gcloud build related logs.
- zone: Use this flag to specify the zone to use for build-related temporary VMs.
NOTE: Make sure the command session stays active. If the session disconnects, the import job is interrupted.
- In the GCP console, navigate to Menu > Cloud Build > History.
- Verify the status of the running job.
- Click the Build number.
- In the Build details window, under the Build log tab, monitor logs.
- Once the build job is completed, the "create-image" (CreateImages) successfully finished status displays in the Build log tab.
- In the GCP console, navigate to Menu > Compute Engine > Images.
- Verify the image is created using the name specified in the command (Step 9).
- Click on the imported image.
- On the Images page, verify the details of the created image.
NOTE: To set up the SWG instance using the imported custom image, see Deploy SWG Instance Using Custom Image.