¿ù°£ Àα⠰Խù°

°Ô½Ã¹° 708°Ç
   
Launch an instance from a volume
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2015-10-06 (È­) 14:11 Á¶È¸ : 5740
                                
Âü°í 


Create volume from image and boot instance
# nova image-list
+--------------------------------------+--------------------------+--------+--------------------------------------+
| ID                                   | Name                     | Status | Server                               |
+--------------------------------------+--------------------------+--------+--------------------------------------+
| 02f51642-2d5c-4d6d-b82c-8ee84e11c845 | CentOS6         | ACTIVE |                                      |
.................................................
.................................................


¡Ø nova boot --flavor FLAVOR --block-device source=${SOURCE},id=${ID},dest=${DEST},size=${SIZE},shutdown=${PRESERVE},bootindex=${INDEX} ${INSTANCE_NAME}
  source=SOURCE
The type of object used to create the block device. Valid values are volume, snapshot, image, and blank.
  id=ID   The ID of the source object.
  dest=DEST   The type of the target virtual device. Valid values are volume and local.
  size=SIZE  The size of the volume that is created.
  shutdown={preserve|remove}
What to do with the volume when the instance is deleted. preserve does not delete the volume. remove deletes the volume.
  bootindex=INDEX  Orders the boot disks. Use 0 to boot from this volume.

¡Ø Á¶°Ç : Cinder Volume »çÀÌÁî Glance À̹ÌÁöº¸´Ù´Â °°°Å³ª Ä¿¾ßÇѴٴ°Í...
              ±×·¸Áö ¾ÊÀ»°æ¿ì¿¡´Â ¿¡·¯


Example1)
# nova boot --flavor m1.medium --block-device source=image,id=02f51642-2d5c-4d6d-b82c-8ee84e11c845,dest=volume,size=30,shutdown=preserve,bootindex=0 test2 --nic net-id=05fe2655-c9cc-4dec-9b00-aec8d55682f0 --availability-zone nova:compute2
+--------------------------------------+--------------------------------------------------+
| Property                             | Value                                            |
+--------------------------------------+--------------------------------------------------+
| OS-DCF:diskConfig                    | MANUAL                                           |
| OS-EXT-AZ:availability_zone          | nova                                             |
| OS-EXT-SRV-ATTR:host                 | -                                                |
| OS-EXT-SRV-ATTR:hypervisor_hostname  | -                                                |
| OS-EXT-SRV-ATTR:instance_name        | instance-0000010a                                |
| OS-EXT-STS:power_state               | 0                                                |
| OS-EXT-STS:task_state                | scheduling                                       |
| OS-EXT-STS:vm_state                  | building                                         |
| OS-SRV-USG:launched_at               | -                                                |
| OS-SRV-USG:terminated_at             | -                                                |
| accessIPv4                           |                                                  |
| accessIPv6                           |                                                  |
| adminPass                            | 52Nw2wJPDVnX                                     |
| config_drive                         |                                                  |
| created                              | 2015-10-06T06:55:55Z                             |
| flavor                               | m1.medium (9f02b716-79b5-4bcd-b249-e34c72391435) |
| hostId                               |                                                  |
| id                                   | 132cd568-2823-4250-bd7f-4dcb118f3828             |
| image                                | Attempt to boot from volume - no image supplied  |
| key_name                             | -                                                |
| metadata                             | {}                                               |
| name                                 | test2                                            |
| os-extended-volumes:volumes_attached | []                                               |
| progress                             | 0                                                |
| security_groups                      | default                                          |
| status                               | BUILD                                            |
| tenant_id                            | 3fdf67182adc4458a36b6dcdc77bce93                 |
| updated                              | 2015-10-06T06:55:56Z                             |
| user_id                              | 85fc7ae7e0364439b2273ac83a7e70a4                 |
+--------------------------------------+--------------------------------------------------+


# cinder list
................................................
................................................
| d2edaf94-481e-4b3b-bf1f-8c20df0cd889 |   in-use  |            None            |  30  |     None    |   true   | 132cd568-2823-4250-bd7f-4dcb118f3828 |
- Volume Name Á¤ÇÒ¼ö ¾øÀ½(None)
- attached to INSTANCE_ID

shutdown=preserve ¿É¼ÇÀ¸·Î ¾Æ·¡¹®Á¦ ÇØ°á
ÀνºÅϽº »èÁ¦½Ã CInder Volume ÀÌ °°ÀÌ »èÁ¦µÇÁö ¾Ê°í º°µµ·Î »èÁ¦
# nova delete ${Instancd_ID}
# cinder delete ${Cinder_Volume_ID}

Cinder »èÁ¦½Ã OpenStack ³»¿¡¼­ ½ÇÇàµÇ´Â ¸í·É¾î (µð½ºÅ© Å©±â°¡ Ŭ¼ö·Ï »èÁ¦½Ã ¿À·¡ °É¸²)
# sudo cinder-rootwrap /etc/cinder/rootwrap.conf dd if=/dev/zero of=/dev/mapper/cinder--volumes-volume--${Volume_ID} count=30720 bs=1M oflag=direct
# /usr/bin/python /usr/bin/cinder-rootwrap /etc/cinder/rootwrap.conf dd if=/dev/zero of=/dev/mapper/cinder--volumes-volume--${Volume_ID} count=30720 bs=1M oflag=direct
# /bin/dd if=/dev/zero of=/dev/mapper/cinder--volumes-volume--${Volume_ID} count=30720 bs=1M oflag=direct


Example2)
# cinder create --display-name my-volume --image-id=bd68102e-670e-454b-a601-4c333dc3dd12 10
# nova boot --flavor m1.medium --image CentOS6 --nic net-id=05fe2655-c9cc-4dec-9b00-aec8d55682f0 --block-device source=volume,id=b93aecfc-0e1c-49d6-9508-8f2392731c3f,dest=volume,shutdown=preserve,bootindex=0 jyh2

# cinder list
................................................
................................................
d372a4c5-3f6d-464a-8fd5-42a55150ccbc |   in-use  |         my-volume          |  10  |     None    |   true   | a710a135-e0ed-4be8-8b68-9bd73f3b11d8

shutdown=preserve ¿É¼ÇÀ¸·Î ¾Æ·¡¹®Á¦ ÇØ°á
ÀνºÅϽº »èÁ¦½Ã CInder Volume ÀÌ °°ÀÌ »èÁ¦µÇÁö ¾Ê°í º°µµ·Î »èÁ¦
# nova delete ${Instancd_ID}
# cinder delete ${Cinder_Volume_ID}

À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

 



 
»çÀÌÆ®¸í : ¸ðÁö¸®³× | ´ëÇ¥ : ÀÌ°æÇö | °³ÀÎÄ¿¹Â´ÏƼ : ·©Å°´åÄÄ ¿î¿µÃ¼Á¦(OS) | °æ±âµµ ¼º³²½Ã ºÐ´ç±¸ | ÀüÀÚ¿ìÆí : mojily°ñ¹ðÀÌchonnom.com Copyright ¨Ï www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.