Skip to content

Latest commit

 

History

History

04-create-vm-with-2-disk

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Get subnet list

yc vpc subnet list

Show availability zones

yc compute zone list

Create virtual machine (instances). Default CPU 2, MEM 2GB, DISK 5GB

yc compute instance create \
    --name first-instance \
    --hostname first-instance \
    --zone ru-central1-b \
    --network-interface subnet-name=default-ru-central1-b,nat-ip-version=ipv4 \
    --create-boot-disk image-folder-id=standard-images,image-family=ubuntu-2004-lts \
    --create-disk name=second-disk,size=5GB,auto-delete \
    --ssh-key ~/.ssh/id_rsa.pub

List virtual machine (instances)

yc compute instance list

Get public ip

yc compute instance get first-instance --format json | jq -r '.network_interfaces[].primary_v4_address.one_to_one_nat.address'

Enter in instance

ssh yc-user@ip

Delete the specified virtual machine (instances)

yc compute instance delete first-instance

Links: