[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-users] Test of XCP 1.5: xe vm-install / xe vm-add-disk CLI options for VDI (sm-config:type=raw)



Hello,

Thanks a lot for XCP 1.5. I did some tests and run in some issues.

Description:
I use the following script to create local SRs. It works fine.
# ---
#!/bin/bash
# Usage: $basename <xcp_host_name> <sr_label> <sr_device>

XCP_HOST_ID=`xe host-list name-label="${1}" | sed -n 's/^uuid .*: //p'`
SR_LABEL="$2"
SR_DEVICE=$3

# Example values
#XCP_HOST_ID=dev70
#SR_LABEL="dev70 local LVM SR 2"
#SR_DEVICE=/dev/sdb

### # Create local SR (storage repository) on the given XCP host
xe sr-create host-uuid=$XCP_HOST_ID content-type=user name-label="${SR_LABEL}" shared=false device-config:device=${SR_DEVICE} type=lvm
SR_ID=`xe sr-list name-label="${SR_LABEL}" | sed -n 's/^uuid .*: //p'`
# ---



I use the following script to create local VDIs. It works fine too, however I *didn't* find any possibility to attach such VDI with it's specific options (*sm-config:type=raw*) to VM or create such VDI with "xe vm-disk-add ...." (as I am getting there always *sm-config:vhd_type=vhd*).
# ---
#!/bin/bash
# Usage: $basename <xcp_host_name> <sr_label> <vdi_label> <vdi_size>

XCP_HOST_ID=`xe host-list name-label="${1}" | sed -n 's/^uuid .*: //p'`
SR_LABEL="$2"
VDI_LABEL="$3"
VDI_SIZE=$4
SR_ID=`xe sr-list name-label="${SR_LABEL}" | sed -n 's/^uuid .*: //p'`

# Create new VDI (virtual disk image) with sm-config:type=raw
xe vdi-create name-label="${VDI_LABEL}" sr-uuid=$SR_ID type=user sm-config:type=raw virtual-size=${VDI_SIZE}GiB
# ---


It creates the following VDI:
# ---
[root@dev70 ~]# xe vdi-list sr-name-label="dev70 LVM LSR 2" params=
| sed '/sm-config/s/^.../!!!/'
uuid ( RO)                    : a1716731-a277-431c-a8a9-dbf373178d1d
              name-label ( RW): manualy created VDI dns10
        name-description ( RW):
           is-a-snapshot ( RO): false
             snapshot-of ( RO): <not in database>
               snapshots ( RO):
           snapshot-time ( RO): 19700101T00:00:00Z
      allowed-operations (SRO): update; resize; destroy; clone; copy; snapshot
      current-operations (SRO):
                 sr-uuid ( RO): 593fd6ff-22b7-d247-d29b-747fd81449bd
           sr-name-label ( RO): dev70 LVM LSR 2
               vbd-uuids (SRO):
         crashdump-uuids (SRO):
            virtual-size ( RO): 68719476736
    physical-utilisation ( RO): 68719476736
                location ( RO): a1716731-a277-431c-a8a9-dbf373178d1d
                    type ( RO): User
                sharable ( RO): false
               read-only ( RO): false
            storage-lock ( RO): false
                 managed ( RO): true
                  parent ( RO): <not in database>
                 missing ( RO): false
            other-config (MRW):
           xenstore-data (MRO):
!!!            sm-config (MRO): type: raw; vdi_type: aio
                 on-boot ( RW): persist
           allow-caching ( RW): false
         metadata-latest ( RO): false
        metadata-of-pool ( RO): <not in database>
                    tags (SRW):
# ---



Just another scipt (a part of it directly below and full version in attachment) creates the VM.
# ---
# Create new VM
VM_ID=`xe vm-install new-name-label="${VM_LABEL}" sr-name-label="${SR_LABEL}" template="Other install media"`

xe vm-disk-add vm=$VM_LABEL sr-uuid=$SR_ID device=0 disk-size=${VDI_SIZE}GiB
# ---


It creates the following VDI:
# ---
[root@dev70 ~]# xe vdi-list sr-name-label="dev70 LVM LSR 4" params= | sed '/sm-config/s/^.../!!!/'
uuid ( RO)                    : 5209033b-b5ba-468f-a0aa-347569c1a701
              name-label ( RW): VDI dns10
        name-description ( RW): Created by xe
           is-a-snapshot ( RO): false
             snapshot-of ( RO): <not in database>
               snapshots ( RO):
           snapshot-time ( RO): 19700101T00:00:00Z
      allowed-operations (SRO): update; resize; destroy; clone; copy; snapshot
      current-operations (SRO):
                 sr-uuid ( RO): 69f7556f-a73f-b5aa-5f1f-729fa3b4a84b
           sr-name-label ( RO): dev70 LVM LSR 4
               vbd-uuids (SRO): 81c18211-14af-f603-2120-8f5cd3252335
         crashdump-uuids (SRO):
            virtual-size ( RO): 51539607552
    physical-utilisation ( RO): 51648659456
                location ( RO): 5209033b-b5ba-468f-a0aa-347569c1a701
                    type ( RO): User
                sharable ( RO): false
               read-only ( RO): false
            storage-lock ( RO): false
                 managed ( RO): true
                  parent ( RO): <not in database>
                 missing ( RO): false
            other-config (MRW):
           xenstore-data (MRO):
!!!            sm-config (MRO): vdi_type: vhd; vmhint: 80db367b-4d59-a2d8-06c0-7fe6cf1b6c8b
                 on-boot ( RW): persist
           allow-caching ( RW): false
         metadata-latest ( RO): false
        metadata-of-pool ( RO): <not in database>
                    tags (SRW):
#
---

I have checked the Xen-6.0.0-reference handbook but didn't find needed details.

My questions:
1. Is there a possible "*sm-config:type=raw*" option on the "xe vm-disk-add ..." command line?
2. Is it possible to specify "*vdi-uuid*" (instead of sr-uuid) on the "xe vm-disk-add vm=..."  command line?


Thank you in advance for any hints.

regards, Mark
-- 
ms@xxxxxxxxxxxxxxxxxxxxxx

http://rsync.it-infrastrukturen.org

Attachment: create-local-vm.sh
Description: Bourne shell script

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.