Uplod image to Google GCP


To upload the image to GCP download the image disk.tar.gz and upload it to your bucket:

gsutil cp disk.tar.gz gs://your-bucket/

probably you will need to run gcloud init, more info: https://cloud.google.com/storage/docs/gsutil_install

Then create the image:

gcloud compute images create freebsd --source-uri gs://your-bucket/disk.tar.gz

The output should be like:

Created [https://www.googleapis.com/compute/v1/projects/x-fabric-167819/global/images/freebsd].
NAME     PROJECT          FAMILY  DEPRECATED  STATUS
freebsd  x-fabric-167819                      READY

Before starting the instance ssh-keys could be added on the metadata section

gcp metadata

Notice the key name is: keys

Finaly create the instance:

gcloud compute instances create example-f1-micro --machine-type f1-micro --image freebsd --zone europe-west1-c --boot-disk-size 10GB

The output:

WARNING: You have selected a disk size of under [200GB]. This may result in poor I/O performance. For more information, see: https://developers.google.com/compute/docs/disks#pdperformance.
Created [https://www.googleapis.com/compute/v1/projects/x-fabric-167819/zones/europe-west1-c/instances/example-f1-micro].
NAME              ZONE            MACHINE_TYPE  PREEMPTIBLE  INTERNAL_IP  EXTERNAL_IP    STATUS
example-f1-micro  europe-west1-c  f1-micro                   10.132.0.2   104.199.60.70  RUNNING

Try to ssh and fine tune the app, see after booting

Example of an ifconfig after booting:

[[email protected]:/usr/local/etc] [7:29:51pm Tue] > ifconfig
vtnet0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1460
        options=6c07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWTSO,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        ether 42:01:0a:84:00:02
        inet6 fe80::4001:aff:fe84:2%vtnet0 prefixlen 64 scopeid 0x1
        inet 10.132.0.2 netmask 0xffffffff broadcast 10.132.0.2
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        media: Ethernet 10Gbase-T <full-duplex>
        status: active
enc0: flags=41<UP,RUNNING> metric 0 mtu 1536
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        groups: enc
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 1460
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
        inet 127.0.0.1 netmask 0xff000000
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        groups: lo
pflog0: flags=141<UP,RUNNING,PROMISC> metric 0 mtu 33160
        groups: pflog
pfsync0: flags=41<UP,RUNNING> metric 0 mtu 1500
        groups: pfsync
        syncpeer: 0.0.0.0 maxupd: 128 defer: off
lo1: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 1460
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet 172.16.13.1 netmask 0xffffff00
        inet 172.16.13.2 netmask 0xffffffff
        inet 172.16.13.3 netmask 0xffffffff
        inet 172.16.13.4 netmask 0xffffffff
        inet 172.16.13.5 netmask 0xffffffff
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        groups: lo
comments powered by Disqus