Update an instance
Add and remove resources from running instances, such as persistent volume storage, network interfaces, or public IP addresses. Update instance metadata and the security groups that the instance belongs to.
To run openstack client commands on the cloud, you must specify the name of the cloud detailed in your clouds.yaml file. You can specify the name of the cloud by using one of the following methods:
- Use the
--os-cloudoption with each command, for example:$ openstack flavor list --os-cloud <cloud_name>Use this option if you access more than one cloud.
- Create an environment variable for the cloud name in your
bashrcfile:`export OS_CLOUD=<cloud_name>`
Attach a network to an instance Copy linkLink copied!
Attach a network to a running instance to add a network interface. The Compute service (nova) creates the port automatically. Use this method when you want the default security group and there is only one subnet.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and they have provided you with a
clouds.yamlfile for you to access the cloud. - You have installed the
python-openstackclientpackage.
Procedure Copy linkLink copied!
Detach a network from an instance Copy linkLink copied!
Detach a network from an instance to remove all its ports. To detach only a specific port while keeping other ports on the same network, detach the port instead.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and they have provided you with a
clouds.yamlfile for you to access the cloud. - You have installed the
python-openstackclientpackage.
About this task Copy linkLink copied!
Procedure Copy linkLink copied!
Attach a port to an instance Copy linkLink copied!
Attach a network interface to a running instance by using a port. A port can be attached to only one instance at a time. Use a port instead of a network when you need a custom security group or there are multiple subnets.
Before you begin Copy linkLink copied!
- If you are attaching a port with an SR-IOV vNIC to an instance, you have a free SR-IOV device on the host on the appropriate physical network, and the instance has a free PCIe slot.
- The administrator has created a project for you and they have provided you with a
clouds.yamlfile for you to access the cloud. - You have installed the
python-openstackclientpackage.
About this task Copy linkLink copied!
num_pcie_ports parameter to configure the number of PCIe devices that can be added to an instance, before a reboot of the instance is required to add more devices.Procedure Copy linkLink copied!
Detach a port from an instance Copy linkLink copied!
Detach a specific port from an instance to remove a single network interface without affecting other ports on the same network.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and they have provided you with a
clouds.yamlfile for you to access the cloud. - You have installed the
python-openstackclientpackage.
Procedure Copy linkLink copied!
Attach a volume to an instance Copy linkLink copied!
Attach a volume to an instance for persistent storage. A volume can be attached to only one instance at a time, unless it is configured as a multi-attach volume.
Before you begin Copy linkLink copied!
- To attach a multi-attach volume, the environment variable
OS_COMPUTE_API_VERSIONis set to 2.60 or later. - The instance is fully operational, or fully stopped. You cannot attach a volume to an instance when the instance is in the process of booting up or shutting down.
- To attach more than 26 volumes to your instance, the image you used to create the instance must have the following properties:
hw_scsi_model=virtio-scsihw_disk_bus=scsi
- The administrator has created a project for you and they have provided you with a
clouds.yamlfile for you to access the cloud. - You have installed the
python-openstackclientpackage.
Procedure Copy linkLink copied!
View the volumes attached to an instance Copy linkLink copied!
View the volumes attached to an instance to verify storage assignments before performing operations.
Before you begin Copy linkLink copied!
- You are using
python-openstackclient 5.5.0. - The administrator has created a project for you and they have provided you with a
clouds.yamlfile for you to access the cloud. - You have installed the
python-openstackclientpackage. * .Procedure - List the volumes attached to an instance:
$ openstack server volume list <instance> +---------------------+----------+---------------------+-----------------------+ | ID | Device | Server ID | Volume ID | +---------------------+----------+---------------------+-----------------------+ | 1f9dcb02-9a20-4a4b- | /dev/vda | ab96b635-1e63-4487- | 1f9dcb02-9a20-4a4b-9f | | 9f25-c7846a1ce9e8 | | a85c-854197cd537b | 25-c7846a1ce9e8 | +---------------------+----------+---------------------+-----------------------+
Detach a volume from an instance Copy linkLink copied!
Detach a volume from an instance to release the persistent storage. The volume data is preserved and can be reattached to another instance.
Before you begin Copy linkLink copied!
- The instance is fully operational, or fully stopped. You cannot detach a volume from an instance when the instance is in the process of booting up or shutting down.
- The administrator has created a project for you and they have provided you with a
clouds.yamlfile for you to access the cloud. - You have installed the
python-openstackclientpackage.