Got it

How Do I Query VMs Provisioned by an Image of HUAWEI CLOUD Stack?

Created: Jun 24, 2022 12:48:23Latest reply: Jun 24, 2022 12:55:05 151 2 0 0 0
  Rewarded HiCoins: 0 (problem resolved)

Hello, everyone!

How do I check the VMs provisioned by an image using the CLI?

Huawei CLOUD Stack version is 8.0.

Can you help me?

Thanks in advance!

  • x
  • convention:

Featured Answers
olive.zhao
Admin Created Jun 24, 2022 12:55:05

Hello, friend!

1. Log in to the first controller node, import environment variables, and run the following command to query the node where the active GaussDB node resides:

cps template-instance-list --service gaussdb gaussdb

cps template-instance-list --service gaussdb gauss

2. Run the following command to query the image ID:

glance image-list

glance image-list

3. Log in to the node where the active GaussDB is deployed and run the following command to query the VM created using the EVS disk. Replace xxxxxxxx with the image ID obtained in step 2 and ***** is the database password.

echo "select INSTANCE_UUID,DELETED,ATTACH_STATUS,CREATED_AT from VOLUME_ATTACHMENT where volume_id in (select volume_id from VOLUME_GLANCE_METADATA where key='image_id' and deleted='f' and value='xxxxxxxx')"|su gaussdba -c 'export GAUSSPASSWORD=*****; /opt/gaussdb/app/bin/gsql cinder'

4. Log in to the node where the active GaussDB is deployed and run the following command to query the VM created on the local disk. Replace xxxxxxxx with the image ID obtained in step 2 and * * * * * indicates the database password.

echo "select INSTANCE_UUID,DELETED,SOURCE_TYPE,DESTINATION_TYPE,CREATED_AT from block_device_mapping where DESTINATION_TYPE='local' and image_id='xxxxxxxx'"|su gaussdba -c 'export GAUSSPASSWORD=**; /opt/gaussdb/app/bin/gsql nova'

Hope this helps!

View more
  • x
  • convention:

user_4463975
user_4463975 Created Jun 25, 2022 13:34:11 (0) (0)
 
All Answers
olive.zhao
olive.zhao Admin Created Jun 24, 2022 12:55:05

Hello, friend!

1. Log in to the first controller node, import environment variables, and run the following command to query the node where the active GaussDB node resides:

cps template-instance-list --service gaussdb gaussdb

cps template-instance-list --service gaussdb gauss

2. Run the following command to query the image ID:

glance image-list

glance image-list

3. Log in to the node where the active GaussDB is deployed and run the following command to query the VM created using the EVS disk. Replace xxxxxxxx with the image ID obtained in step 2 and ***** is the database password.

echo "select INSTANCE_UUID,DELETED,ATTACH_STATUS,CREATED_AT from VOLUME_ATTACHMENT where volume_id in (select volume_id from VOLUME_GLANCE_METADATA where key='image_id' and deleted='f' and value='xxxxxxxx')"|su gaussdba -c 'export GAUSSPASSWORD=*****; /opt/gaussdb/app/bin/gsql cinder'

4. Log in to the node where the active GaussDB is deployed and run the following command to query the VM created on the local disk. Replace xxxxxxxx with the image ID obtained in step 2 and * * * * * indicates the database password.

echo "select INSTANCE_UUID,DELETED,SOURCE_TYPE,DESTINATION_TYPE,CREATED_AT from block_device_mapping where DESTINATION_TYPE='local' and image_id='xxxxxxxx'"|su gaussdba -c 'export GAUSSPASSWORD=**; /opt/gaussdb/app/bin/gsql nova'

Hope this helps!

View more
  • x
  • convention:

user_4463975
user_4463975 Created Jun 25, 2022 13:34:11 (0) (0)
 

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.
Information Protection Guide
Thanks for using Huawei Enterprise Support Community! We will help you learn how we collect, use, store and share your personal information and the rights you have in accordance with Privacy Policy and User Agreement.