2
votes

I am new to Google Compute Engine. I want to create a Web Server having following properties:

  • 1 Core
  • Red Hat Enterprise Linux 7.1 64 bit
  • RAM 8 GB
  • HDD: 100 GB
  • SSH, JDK 1.7
  • Apache Web server as the proxy to Jboss App Server
  • Enable HTTP / 80 and HTTPS /443  on public IP
  • Access Mode – SSH/SCP

I created a new instance having Linux Red Hat 7.1 and machine type n1-standard-2 that provide 2 CPU cores and 7.5 GB of RAM. Can I define exactly one core with 100 GB HD and 8 GB RAM? And how can I define access mode SSH/SCP ?

2

2 Answers

4
votes

* I'd like add this update to my answer: Now it's possible to customize the machine type based on your hardware requirements.*

When creating a Compute Engine VM instance you will need to specify a machine type. There is no way to specify amount of CPU and memory. However, you can select a machine type which will be close to your hardware requirements.

For the persistent disk, using the gcloud command tool you can create a disk with the desired size:

$ gcloud compute disks create DISK_NAME --image IMAGE --size 100GB --zone ZONE

Then create your VM instance using your root persistent disk:

$ gcloud compute instances create INSTANCE_NAME --disk name=DISK_NAME boot=yes --zone ZONE

Since Automatic Resizing of root persistent disks is not supported by Compute Engine for Red Hat Enterprise operating system, you will need to manually repartition your disk. You can visit this article for information about repartitioning a root persistent disk.

3
votes

Can I define exactly one core with 100 GB HD and 8 GB RAM?

No, you can only use predefined machine shapes with the preassigned amounts of CPU and RAM.

See Kamran's answer for how to create a disk of a different size, that is separate from CPU and RAM.

And how can I define access mode SSH/SCP?

That's automatically done for you and it's already running an SSH server. Note that by default, it uses SSH keys, not passwords. To connect to your GCE VM, see these docs; the command would look like:

gcloud compute ssh INSTANCE-NAME --project=PROJECT --zone=ZONE

You can also connect to your instance via your web browser by using the SSH button in the Developers Console.

To use scp, use the flags that are provided for the ssh command, e.g.,

scp -i KEY_FILE \
    -o UserKnownHostsFile=/dev/null \
    -o CheckHostIP=no \
    -o StrictHostKeyChecking=no \
    [source-files ...] \
    USER@IP_ADDRESS:[dest-location]

or vice versa to copy them back.