You are browsing a read-only backup copy of Wikitech. The primary site can be found at wikitech.wikimedia.org

Help:Suspending instances: Difference between revisions

From Wikitech-static
Jump to navigation Jump to search
imported>Ryan Lane
No edit summary
 
imported>Quiddity
(lang="bash")
 
Line 1: Line 1:
{{DocumentationPage}}
If you need to stop activity on a given instance and do not want to destroy it, you can either suspend or pause it.
Occasionally it's needed to suspend instances, rather than destroying them. Note that if you suspend a user's instances, they can un-suspend them if they have access to reboot the instances, so you'll need to [[Disabling_an_account|disable the user's]] account if you want to avoid that. Here's the steps to disable instances:


# Find out which host is running the instance (run on the controller):
Pausing an instance is similar to putting your laptop to sleep, the instance state remains in memory:
#: euca-describe-instances
 
# On the specified host, use virsh to suspend the instance:
<syntaxhighlight lang="bash">
#: virsh suspend i-<instancenumber>
root@cloudcontrol1003:~# OS_PROJECT_ID=project openstack server pause servername
root@cloudcontrol1003:~# OS_PROJECT_ID=project openstack server unpause servername
</syntaxhighlight>
 
Suspending an instance is akin to hibernation, where the contents of the instance state is written to disk:
 
<syntaxhighlight lang="bash">
root@cloudcontrol1003:~# OS_PROJECT_ID=project openstack server suspend servername
root@cloudcontrol1003:~# OS_PROJECT_ID=project openstack server resume servername
</syntaxhighlight>
 
Depending on how long the instance remains in paused/suspended state, it's possible the SSH sessions will resume working once the instance is reactivated due to SSH session timeouts not being reached. It really depends on your SSH client configuration.
 
'''IMPORTANT:''' A user can reactivate a paused/suspended instance by simply rebooting it. If you really want to ensure the instance is not reactivated by the user, you will need to [[Disabling_an_account|disable their account]].

Latest revision as of 20:15, 22 February 2019

If you need to stop activity on a given instance and do not want to destroy it, you can either suspend or pause it.

Pausing an instance is similar to putting your laptop to sleep, the instance state remains in memory:

root@cloudcontrol1003:~# OS_PROJECT_ID=project openstack server pause servername
root@cloudcontrol1003:~# OS_PROJECT_ID=project openstack server unpause servername

Suspending an instance is akin to hibernation, where the contents of the instance state is written to disk:

root@cloudcontrol1003:~# OS_PROJECT_ID=project openstack server suspend servername
root@cloudcontrol1003:~# OS_PROJECT_ID=project openstack server resume servername

Depending on how long the instance remains in paused/suspended state, it's possible the SSH sessions will resume working once the instance is reactivated due to SSH session timeouts not being reached. It really depends on your SSH client configuration.

IMPORTANT: A user can reactivate a paused/suspended instance by simply rebooting it. If you really want to ensure the instance is not reactivated by the user, you will need to disable their account.