LoginSignup
0
1

More than 5 years have passed since last update.

Vagrantでスナップショットを使って(゚∀゚)ウマウマする

Posted at

vagrant snapshot save [スナップショット名]

bash-3.2# vagrant snapshot save snapshot_test
==> default: Snapshotting the machine as 'snapshot_test'...
==> default: Snapshot saved! You can restore the snapshot at any time by
==> default: using `vagrant snapshot restore`. You can delete it using
==> default: `vagrant snapshot delete`.
bash-3.2# vagrant snapshot save snapshot_ut
==> default: Snapshotting the machine as 'snapshot_ut'...
==> default: Snapshot saved! You can restore the snapshot at any time by
==> default: using `vagrant snapshot restore`. You can delete it using
==> default: `vagrant snapshot delete`.
bash-3.2#

vagrant snapshot list

bash-3.2# vagrant snapshot list
snapshot_test
snapshot_ut
bash-3.2#

vagrant snapshot restore [スナップショット名]

bash-3.2# vagrant snapshot restore snapshot_ut
==> default: Forcing shutdown of VM...
==> default: Restoring the snapshot 'snapshot_ut'...
==> default: Resuming suspended VM...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
bash-3.2#

push, popも使える

bash-3.2# vagrant snapshot push
==> default: Snapshotting the machine as 'push_1494041160_9738'...
==> default: Snapshot saved! You can restore the snapshot at any time by
==> default: using `vagrant snapshot restore`. You can delete it using
==> default: `vagrant snapshot delete`.
bash-3.2# vagrant snapshot list
push_1494041160_9738
snapshot_test
snapshot_ut
bash-3.2# vagrant snapshot pop
==> default: Forcing shutdown of VM...
==> default: Restoring the snapshot 'push_1494041160_9738'...
==> default: Deleting the snapshot 'push_1494041160_9738'...
==> default: Snapshot deleted!
==> default: Resuming suspended VM...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
bash-3.2#

捕捉

  • バージョン1.8.6だと私の環境ではうまく動かない部分があったため、1.9.4にバージョンアップしたところ解消できた
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1