Share a persistent disk between Google Compute Engine VMs -
from google's documentation:
it possible attach persistent disk more 1 instance. however, if attach persistent disk multiple instances, instances must attach persistent disk in read-only mode. not possible attach persistent disk multiple instances in read-write mode.
if attach persistent disk in read-write mode , try attach disk subsequent instances, google compute engine returns error.
so, need have share persistent-disk frontend compute engine, good, how can write on shared disk?
my guess (i hope) a read/write persistent-disk can attached 1 compute engine same disk can share in read others vms, thats right?
lets have 2 compute engine vms , 2 persistent disks, flow possible?
- compute1 read/write disk1 , read disk2
- compute2 read/write disk2 , read disk1
no, not possible, documentation cited @ time of writing said (since updated):
however, if attach persistent disk multiple instances, instances must attach persistent disk in read-only mode.
the documentation has been re-arranged since then; new docs @ different url same content:
you can attach non-root persistent disk more 1 virtual machine instance in read-only mode, allows share static data between multiple instances. sharing static data between multiple instances 1 persistent disk cheaper replicating data unique disks individual instances.
if attach persistent disk multiple instances, of instances must attach persistent disk in read-only mode. not possible attach persistent disk multiple instances in read-write mode. if need share dynamic storage space between multiple instances, connect instances cloud storage or create network file server.
if have persistent disk data want share between multiple instances, detach read-write instances , attach 1 or more instances in read-only mode.
which means cannot have 1 instance have write access while has read-only access.
if want share data between them, need use other persistent disk. below possible solutions.
you can use of following hosted/managed services:
- google cloud datastore
- google cloud storage, can use via gcs api (json or xml) or can mount using gcsfuse block device
- google cloud bigtable
- google cloud sql
alternatively, can run own:
Comments
Post a Comment