Preserve my persistent disk across notebook VM/Cluster recreation Completed

Post author
Matt Bookman

Google Compute Engine allows for you to change the machine type of an instance as described here:

Changing the Machine Type of a Stopped Instance

In Terra, if I stop my notebook VM and change the configuration, my existing instance gets destroyed.

Similarly, Google Compute Engine allows for you to increase the size of a persistent disk as described here:

Adding or Resizing Zonal Persistent Disks

In Terra, I don't have an option of increasing the size of the PD.

This means that I end up needing to reinstall libraries and tools on my VM, and so I might instead decide to just plug along. We lose a great piece of GCE functionality here.

 

Comments

1 comment

  • Comment author
    Matt Bookman

    This feature request was implemented and rolled out back in September:

    Ran a test of this:

    1- Create new Cloud Environment with 4 CPUs and 15 GB of memory, 50 GB boot disk, and a 50 GB notebooks PD.

    Verify:

    $ grep ^processor /proc/cpuinfo
    processor : 0
    processor : 1
    processor : 2
    processor : 3

    $ grep ^MemTotal /proc/meminfo
    MemTotal: 15404688 kB
    $ df -kh /home/jupyter-user
    Filesystem Size Used Avail Use% Mounted on
    overlay 50G 13G 35G 26% /

    $ df -kh /home/jupyter-user/notebooks
    Filesystem Size Used Avail Use% Mounted on
    /dev/sdb 49G 53M 49G 1% /home/jupyter-user/notebooks

    2- Deposit test files in the HOME directory and the notebooks directory:

    $ echo "Hello world" > ./hello_world.txt
    $ echo "Hello world" > ./notebooks/hello_world.txt

    3- Update the Cloud Environment with 2 CPUs and 7.5 GB of memory, 50 GB boot disk, and a 200 GB notebooks PD.

    Verify:

    $ grep ^processor /proc/cpuinfo
    processor : 0
    processor : 1

    $ grep ^MemTotal /proc/meminfo
    MemTotal: 7663520 kB

    $ df -kh /home/jupyter-user
    Filesystem Size Used Avail Use% Mounted on
    overlay 50G 13G 35G 26% /

    $ df -kh /home/jupyter-user/notebooks
    Filesystem Size Used Avail Use% Mounted on
    /dev/sdb 197G 59M 197G 1% /home/jupyter-user/notebooks

    Verify that files were preserved:

    $ cat hello_world.txt
    Hello world

    $ cat notebooks/hello_world.txt
    Hello world

    4- Delete the Cloud environment, but choose "Keep persistent disk, delete application configuration and compute profile"

    5- Create new Cloud Environment with 4 CPUs and 15 GB of memory, 50 GB boot disk, and (preserved) 200 GB notebooks PD.

    Verify:

    $ grep ^processor /proc/cpuinfo
    processor : 0
    processor : 1
    processor : 2
    processor : 3

    $ grep ^MemTotal /proc/meminfo
    MemTotal: 15404688 kB

    $ df -kh /home/jupyter-user
    Filesystem Size Used Avail Use% Mounted on
    overlay 50G 13G 35G 26% /

    $ df -kh /home/jupyter-user/notebooks
    Filesystem Size Used Avail Use% Mounted on
    /dev/sdb 197G 59M 197G 1% /home/jupyter-user/notebooks

    Verify that contents of the HOME directory were NOT preserved and that the notebooks directory WAS preserved:

    $ cat hello_world.txt
    cat: hello_world.txt: No such file or directory

    $ cat notebooks/hello_world.txt
    Hello world

     

    0

Please sign in to leave a comment.